c#-Any disadvantages if Static event is called from static constructor -


are there disadvantages assigning static events static constructors?

for example:

public class static test() {     static test()     {         appdomain.currentdomain.domainunload += currentdomain_domainunload;     }      static void currentdomain_domainunload(object sender, eventargs e)     {         cleanup();     } } 

is there disadvantages using ...

no, subscribing event fine.

raising problematic doesn't apply here.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -