-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Mrinal
Message 2 in Discussion

Hi ,   This is very much possible and this is the idea behind Singleton pattern ,    
Simple steps on how you can go ahead to implement this :   1. Create a class with 
Private Constructor , so that it can't be called from somewhere outside directly .   
2. Create a static Hashtable object for storing only instance of the class and it's 
respective key -  Again Private    3. Create a public static method GetInstance and 
make it have same arguments as constructor and return type as class object .   4. Now 
from anywhere outside call GetInstance static method , which in turn will check for 
instance of class available in hashtable , in case it's available it will return the 
same , else it will call private constructor , create a new object and store it in the 
hash table with relevant key and return .   So , only for first time it calls 
constructor and next time onwards it will return from Hashtable .   Have a look at 
following Url to see implemetation , it could be little different , as there are many 
ways to do the same thing but concept remains same :   
http://www.c-sharpcorner.com/Language/SingletonPatternsInCSharpRVS.asp   any other 
doubt , revert back ,   regards ,   Mrinal

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to