// mysingletonusing system; // singletonpage classclass singletonpage {// fields protected static singletonpage checkoutpage;
// Constructor is protected to ensure singleton protected singletonpage ("if you see line, the only one thing inscious!");}
// use this to create singletonpage instance public static singleletonpage newcheckoutpage () {if (checkoutpage == null) checkoutpage = new singletonpage (); return checkoutpage;}
}; // ----------------------------------- End of SingletonPage Class
// TestAppClass TestApp {public static void main (string [] args) {console.writeline ("'Create' Pagea:"); SingletonPage Pagea = SingletonPage.NewCheckoutPage ();
Console.WriteLine ( " 'create' pageb:"); SingletonPage pageb = SingletonPage.NewCheckOutPage (); Console.WriteLine ( " 'create' pagec:"); SingletonPage pagec = SingletonPage.NewCheckOutPage (); Console.WriteLine ( " ' Create 'Paged: "); SingletonPage Paged = SingletonPage.NewcheckoutPage ();
While (TRUE) {}}};