Class DisposableManagedObjectBase
Correclty implements the System.IDisposable interface and pattern for an object containing only managed resources, and adds a few common niceities not on the interface such as an IsDisposed property.
Inheritance
Implements
Inherited Members
Namespace: Rssdp.Infrastructure
Assembly: cs.temp.dll.dll
Syntax
public abstract class DisposableManagedObjectBase : IDisposable
Properties
IsDisposed
Sets or returns a boolean indicating whether or not this instance has been disposed.
Declaration
public bool IsDisposed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
See Also
Methods
Dispose()
Disposes this object instance and all internally managed resources.
Declaration
public void Dispose()
Remarks
Sets the IsDisposed property to true. Does not explicitly throw an exception if called multiple times, but makes no promises about behaviour of derived classes.
See Also
Dispose(Boolean)
Override this method and dispose any objects you own the lifetime of if disposing is true;
Declaration
protected abstract void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | True if managed objects should be disposed, if false, only unmanaged resources should be released. |
ThrowIfDisposed()
Throws and System.ObjectDisposedException if the IsDisposed property is true.
Declaration
protected virtual void ThrowIfDisposed()
Exceptions
| Type | Condition |
|---|---|
| System.ObjectDisposedException | Thrown if the IsDisposed property is true. |