Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Dave Kreskowiak11-Feb-05 3:54
mveDave Kreskowiak11-Feb-05 3:54 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Christian Graus13-Feb-05 19:28
protectorChristian Graus13-Feb-05 19:28 
GeneralRe: Playing wav sounds in a .NET Web App Pin
Dave Kreskowiak11-Feb-05 3:53
mveDave Kreskowiak11-Feb-05 3:53 
GeneralBuilding a treeview from an object graph (reflection) Pin
Rein Petersen10-Feb-05 11:19
Rein Petersen10-Feb-05 11:19 
GeneralFile Compression Pin
Shady Aly10-Feb-05 10:58
Shady Aly10-Feb-05 10:58 
GeneralRe: File Compression Pin
therealmccoy10-Feb-05 11:19
therealmccoy10-Feb-05 11:19 
GeneralRe: File Compression Pin
mikker_12310-Feb-05 15:43
mikker_12310-Feb-05 15:43 
Generalstatic constructors Pin
Yaakov Davis10-Feb-05 8:57
Yaakov Davis10-Feb-05 8:57 
Hi everybody.

There Is a way to change the initialization sequence in static constructors?

I have the following code:
<br />
class MyClass<br />
{<br />
   static int a;<br />
   static bool b = true;<br />
<br />
   static MyClass()<br />
   {<br />
      a = 10;<br />
   }<br />
}<br />
<br />


The compiler generates the following:
<br />
class MyClass<br />
{<br />
   static int a;<br />
   static bool b;<br />
<br />
   static MyClass()<br />
   {<br />
      b = true;<br />
      a = 10;<br />
   }<br />
}<br />



I want that member a will be initialized before b does, but I must do it on runtime.
In other words, there is some parameter that tells the compiler to place the inline initializations in the end of the static constructor?


Thanks a lot,
Yaakov
GeneralRe: static constructors Pin
Dave Kreskowiak10-Feb-05 9:07
mveDave Kreskowiak10-Feb-05 9:07 
GeneralRe: static constructors Pin
Yaakov Davis10-Feb-05 10:09
Yaakov Davis10-Feb-05 10:09 
GeneralRe: static constructors Pin
S. Senthil Kumar10-Feb-05 9:59
S. Senthil Kumar10-Feb-05 9:59 
GeneralSplit app.msi into multiple msi and install-on-demand Pin
Ruchi Gupta10-Feb-05 8:51
Ruchi Gupta10-Feb-05 8:51 
Generaldetecting IE close event Pin
Adnan Siddiqi10-Feb-05 8:50
Adnan Siddiqi10-Feb-05 8:50 
GeneralListView BeforeSelect Pin
stoked10-Feb-05 8:36
stoked10-Feb-05 8:36 
Generalunique identifier on a thread Pin
sameerhanda10-Feb-05 8:30
sameerhanda10-Feb-05 8:30 
GeneralRe: unique identifier on a thread Pin
C# Genius10-Feb-05 8:44
C# Genius10-Feb-05 8:44 
GeneralRe: unique identifier on a thread Pin
Dave Kreskowiak10-Feb-05 9:02
mveDave Kreskowiak10-Feb-05 9:02 
GeneralRe: unique identifier on a thread Pin
Stefan Troschuetz11-Feb-05 0:18
Stefan Troschuetz11-Feb-05 0:18 
GeneralClient/Server Pin
Soumya Mulukutla10-Feb-05 6:58
Soumya Mulukutla10-Feb-05 6:58 
GeneralRe: Client/Server Pin
Michael P Butler10-Feb-05 8:15
Michael P Butler10-Feb-05 8:15 
GeneralRe: Client/Server Pin
S. Senthil Kumar10-Feb-05 8:15
S. Senthil Kumar10-Feb-05 8:15 
GeneralRe: Client/Server Pin
Judah Gabriel Himango10-Feb-05 9:01
sponsorJudah Gabriel Himango10-Feb-05 9:01 
GeneralRe: Client/Server Pin
Soumya Mulukutla10-Feb-05 9:46
Soumya Mulukutla10-Feb-05 9:46 
GeneralRe: Client/Server Pin
Judah Gabriel Himango10-Feb-05 9:59
sponsorJudah Gabriel Himango10-Feb-05 9:59 
QuestionDllImport() with flexible DLL name? Pin
mav.northwind10-Feb-05 6:41
mav.northwind10-Feb-05 6: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.