Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
QuestionHelp on how to develop an sms web portal Pin
abbah22-Jul-09 23:59
abbah22-Jul-09 23:59 
AnswerRe: Help on how to develop an sms web portal Pin
ravindarp23-Jul-09 0:31
ravindarp23-Jul-09 0:31 
QuestionGeneric Question Pin
Programm3r22-Jul-09 22:00
Programm3r22-Jul-09 22:00 
AnswerRe: Generic Question Pin
J4amieC22-Jul-09 22:23
J4amieC22-Jul-09 22:23 
QuestionRe: Generic Question Pin
Programm3r22-Jul-09 22:58
Programm3r22-Jul-09 22:58 
AnswerRe: Generic Question Pin
J4amieC22-Jul-09 23:17
J4amieC22-Jul-09 23:17 
GeneralRe: Generic Question Pin
Programm3r22-Jul-09 23:41
Programm3r22-Jul-09 23:41 
GeneralRe: Generic Question Pin
J4amieC22-Jul-09 23:55
J4amieC22-Jul-09 23:55 
First thing i'd do if I were you is go and read up on the singleton design pattern. The class you have found/written is for that purpose, and that purpose alone. You may have accidentally stumbled upon a tried-and-tested pattern of software design. Thats usually how you come accross such things and will make you a better programmer.

In answer to your question, you would use the fields/methods of your class as follows - assume the "T" passed in is the class MyClass which has an instance method void Foo() and an instance property int Bar.
Singleton<MyClass> singleton = new Singleton<MyClass>();
singleton.Instance.Foo();
singleton.Instance.Bar = 5


Crucially, you would never access a static property/method on MyClass, only instance properties/methods. Thats by convention of course, as I stated originally there is nothing stopping you referencing a static member, MyClass.StaticProperty
GeneralRe: Generic Question Pin
Programm3r23-Jul-09 0:00
Programm3r23-Jul-09 0:00 
GeneralRe: Generic Question Pin
harold aptroot22-Jul-09 23:12
harold aptroot22-Jul-09 23:12 
GeneralRe: Generic Question Pin
Programm3r22-Jul-09 23:30
Programm3r22-Jul-09 23:30 
GeneralRe: Generic Question Pin
J4amieC22-Jul-09 23:33
J4amieC22-Jul-09 23:33 
GeneralRe: Generic Question Pin
Programm3r22-Jul-09 23:45
Programm3r22-Jul-09 23:45 
GeneralRe: Generic Question Pin
J4amieC22-Jul-09 23:55
J4amieC22-Jul-09 23:55 
AnswerRe: Generic Question Pin
PIEBALDconsult23-Jul-09 6:25
mvePIEBALDconsult23-Jul-09 6:25 
QuestionDebugging ASP.NET web application Pin
Chesnokov Yuriy22-Jul-09 21:36
professionalChesnokov Yuriy22-Jul-09 21:36 
AnswerRe: Debugging ASP.NET web application Pin
Vimalsoft(Pty) Ltd23-Jul-09 1:15
professionalVimalsoft(Pty) Ltd23-Jul-09 1:15 
QuestionGlass on MDI container Pin
see_seA22-Jul-09 21:29
see_seA22-Jul-09 21:29 
AnswerRe: Glass on MDI container Pin
see_seA27-Jul-09 12:04
see_seA27-Jul-09 12:04 
AnswerRe: Glass on MDI container Pin
lakhy lakhyan26-Apr-10 7:41
lakhy lakhyan26-Apr-10 7:41 
QuestionRun another Application out of my Application - with the same rights Pin
ss2022-Jul-09 21:24
ss2022-Jul-09 21:24 
Questioninsert date and time in oracle Pin
mjawadkhatri22-Jul-09 20:37
mjawadkhatri22-Jul-09 20:37 
AnswerRe: insert date and time in oracle Pin
Nagy Vilmos22-Jul-09 22:53
professionalNagy Vilmos22-Jul-09 22:53 
GeneralRe: insert date and time in oracle Pin
mjawadkhatri23-Jul-09 0:42
mjawadkhatri23-Jul-09 0:42 
GeneralRe: insert date and time in oracle Pin
Nagy Vilmos23-Jul-09 6:30
professionalNagy Vilmos23-Jul-09 6:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.