Click here to Skip to main content
15,917,618 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 7:45
mvePIEBALDconsult15-Apr-10 7:45 
GeneralRe: How to force static instances of a class to initialize? Pin
Keith Barrow15-Apr-10 10:10
professionalKeith Barrow15-Apr-10 10:10 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 10:22
mvePIEBALDconsult15-Apr-10 10:22 
AnswerRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 5:27
mvePIEBALDconsult15-Apr-10 5:27 
GeneralRe: How to force static instances of a class to initialize? Pin
thugthug15-Apr-10 6:18
thugthug15-Apr-10 6:18 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 7:42
mvePIEBALDconsult15-Apr-10 7:42 
AnswerRe: How to force static instances of a class to initialize? Pin
Luc Pattyn15-Apr-10 6:13
sitebuilderLuc Pattyn15-Apr-10 6:13 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 7:41
mvePIEBALDconsult15-Apr-10 7:41 
Luc Pattyn wrote:
Someone has to take the initiative for a collection to be populated


Therein lies the rub. .net likes to be lazy in its instantiation, and even allows the developer to make it even lazier.
What we need here is to make .net be pro-active.


Luc Pattyn wrote:
reflection code in the static initializer of Translator


I don't even think that would do it.
It appears that, in theory, this should even work for plug-in assemblies that get loaded after the manager class.



I certainly haven't found a way to tell the runtime to initialize the class immediately upon load rather than waiting for some code to reference it.
GeneralRe: How to force static instances of a class to initialize? Pin
Luc Pattyn15-Apr-10 7:47
sitebuilderLuc Pattyn15-Apr-10 7:47 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 7:56
mvePIEBALDconsult15-Apr-10 7:56 
AnswerRe: How to force static instances of a class to initialize? Pin
thugthug15-Apr-10 8:36
thugthug15-Apr-10 8:36 
GeneralRe: How to force static instances of a class to initialize? Pin
Luc Pattyn15-Apr-10 9:06
sitebuilderLuc Pattyn15-Apr-10 9:06 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 9:40
mvePIEBALDconsult15-Apr-10 9:40 
GeneralRe: How to force static instances of a class to initialize? Pin
thugthug15-Apr-10 10:36
thugthug15-Apr-10 10:36 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 11:41
mvePIEBALDconsult15-Apr-10 11:41 
AnswerRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult15-Apr-10 12:05
mvePIEBALDconsult15-Apr-10 12:05 
GeneralRe: How to force static instances of a class to initialize? Pin
thugthug16-Apr-10 2:09
thugthug16-Apr-10 2:09 
GeneralRe: How to force static instances of a class to initialize? Pin
PIEBALDconsult16-Apr-10 4:25
mvePIEBALDconsult16-Apr-10 4:25 
QuestionXmlSerializer doesn't write the namespace Pin
buchstaben15-Apr-10 4:02
buchstaben15-Apr-10 4:02 
AnswerRe: XmlSerializer doesn't write the namespace Pin
Tarakeshwar Reddy15-Apr-10 4:54
professionalTarakeshwar Reddy15-Apr-10 4:54 
QuestionRe: XmlSerializer doesn't write the namespace Pin
buchstaben15-Apr-10 19:43
buchstaben15-Apr-10 19:43 
AnswerRe: XmlSerializer doesn't write the namespace Pin
Tarakeshwar Reddy16-Apr-10 5:01
professionalTarakeshwar Reddy16-Apr-10 5:01 
GeneralRe: XmlSerializer doesn't write the namespace Pin
buchstaben18-Apr-10 20:20
buchstaben18-Apr-10 20:20 
QuestionMessage Removed Pin
15-Apr-10 1:56
kulkarni.ajay15-Apr-10 1:56 
AnswerRe: How to solve->Could not connect to remote machine error Pin
Calla15-Apr-10 3:41
Calla15-Apr-10 3:41 

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.