Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDisposable implementation - What should go in 'if (disposing)'
- // Dispose(bool disposing) executes in two distinct scenarios.
- // If disposing equals true, the method has been called directly
- // or indirectly by a user's code. Managed and unmanaged resources
- // can be disposed.
- // If disposing equals false, the method has been called by the
- // runtime from inside the finalizer and you should not reference
- // other objects. Only unmanaged resources can be disposed.
- protected virtual void Dispose(bool disposing)
- {
- if (!disposed)
- {
- if (disposing)
- {
- // Free other state (managed objects).
- }
- // Free your own state (unmanaged objects).
- // Set large fields to null.
- disposed = true;
- }
- }
- publisher.DoSomeEvent += subscriber.DoSomething;
Add Comment
Please, Sign In to add comment