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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -