From MSDN:
In scenarios where resources must be released at a specific time, classes
can implement the IDisposable interface, which contains the
IDisposable.Dispose method that performs resource management and cleanup
tasks. Classes that implement Dispose must specify, as part of their class
contract, if and when class consumers call the method to clean up the
object. The garbage collector does not, by default, call the Dispose method;
however, implementations of the Dispose method can call methods in the GC
class to customize the finalization behavior of the garbage collector.
So, your best bet (as I understand it) is to implement IDisposable on you
class and call the Dispose method when you're ready for your object to be
collected. That WILL NOT force the Garbage Collector to collect your object.
Need more detail? Here's the best I've seen:
http://www.bluebytesoftware.com/blog/PermaLink.aspx?guid=88e62cdf-5919-4ac7-bc33-20c06ae539ae
Hope this helps,
Dan Cox