Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Object Lifetime   (RSS)

Fun with events and delegates

So how can you verify that a given class raises an event? Well, you can simply write some code that registers an event handler and then cause the target to raise that event. Now, how do you verify that a given class does actually handle an event raised

A good reason for calling GC.Collect()

You've probably heard that you should not call GC .Collect() and generally speaking this is absolutely correct. Yes, there are probably exceptions to that rule but unless you know for sure that calling GC .Collect() will improve the runtime behavior of
 
Page view tracker