Friday, 21 November 2014

Singleton Pattern


public class clsGUIHandler
{

    private static clsGUIHandler instance;
    private clsGUIHandler()
    {
    }
    public static clsGUIHandler Instance
    {
        get
        {
            if (instance == null)
            {
                instance = new clsGUIHandler();
            }
            return instance;
        }
    }

public void display()
{
}

}


Consumer :

clsGUIHandler.Instance.display();