Silverlight Dispatcher

Threading in Silverlight is simple and have very few classes and limited functionality. In Silverlight we rarely go for the threading since the platform itself is asynchronous. Click to read how to do asynchronous programming in C# 5.0 In Silverlight the  main thread is incorporated with the Dispatcher, and we can use the BeginInvoke method … Continue reading Silverlight Dispatcher

Adapter Pattern

Adapter pattern is often mentioned as wrapper in normal convention. It is a pattern which introduces loose coupling when creating a middle interface between two unmatched types. The name itself, self describes itself.  Think we have a class which renders a dataset on the screen. So we’ve a working class like this. class Renderer { … Continue reading Adapter Pattern

Singleton Pattern

Singleton pattern is a simple design pattern in software practice and sometimes considered as an anti-pattern due its tight coupling nature. A very simple non thread safe implementation of the Singleton pattern would be like this. Singleton non thread safe class Singleton {   privatestatic Singleton _instance;   private Singleton()   {     Console.WriteLine("Singleton instantiated"); … Continue reading Singleton Pattern

Execute Batch File without any windows

If you have a need of executing your batch file where you do not want the window to be popped up; here’s the solution to that using VB Script. Open the notepad and type the following CreateObject("Wscript.Shell").Run "<your batch file path>",0 Save the above file in any name you want with the extension .vbs That’s … Continue reading Execute Batch File without any windows