System.IDisposable

It only has one method
Provides a form of deterministic destruction


public interface IDisposable 
{
   void Dispose();
}


The Dispose method makes a call to GC.SuppressFinalize


Setting an object to null does not trigger the Dispose() method to be called


As a rule of thumb, when you use an IDisposable object you should declare and instantiate it in a using statement
This calls the Dispose method on the object in the right way.





© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext