Class DisposableObject
Provides a mechanism for releasing managed and unmanaged resources.
public class DisposableObject : BaseObjectWithNotify, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IDisposable, IBaseObject
- Inheritance
-
DisposableObject
- Implements
- Derived
- Extension Methods
Constructors
- DisposableObject()
Initializes a new instance of the DisposableObject class.
- DisposableObject(bool)
Initializes a new instance of the DisposableObject class.
Properties
- DisposeHandle
Gets or sets whether to call DisposeUnmanaged() method when this object is disposed.
- Disposing
Gets whether object is currently disposing.
- DisposingOrDisposed
Gets whether this object is disposing or disposed.
- EmptyDisposable
Gets the disposable that does nothing when disposed.
- IsDisposed
Gets whether object is disposed.
Methods
- CheckDisposed()
Throws ObjectDisposedException if IsDisposed is
true.
- Dispose(bool)
Disposes object's resources.
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- DisposeUnmanaged()
Override to dispose unmanaged resources.
- ~DisposableObject()
Finalizes an instance of the DisposableObject class.
- RunWhenIdle(Action)
Adds
actionwhich will be executed one time when the application finished processing events and is about to enter the idle state.
Events
- Disposed
Occurs when object is disposed. This is event is raised before any dispose logic is executed. You can use this event to perform any operations before the object is disposed.
- InstanceDisposed
Occurs when object is disposed. This is static event, so it is raised for all instances of this class and its derived classes.