Example

C# IDisposable Interface Implementation

Long long time ago I dissected the IDisposable interface (simple enough as it is) and made a "correct" implementation example essentially by commenting out MSDN code for better understanding what for and why you should do as it says:
class DisposableExample: IDisposable {
        #region Absolute minimum of the code required for correct implementation of IDisposable
        /// 
        /// Field that will be set to true if attempt to destroy the object was already made.
        /// 
        private bool isDisposed = false;

        /// 
Rating: 
Subscribe to RSS - Example