MarshalByRefDisposableObject Class
Provides a base class that implements the IDisposable interface. This class functions in accordance with the Disposable design pattern.
public abstract class MarshalByRefDisposableObject : MarshalByRefObject, IDisposable
- Inheritance:
- object MarshalByRefObject object
- Implements:
- IDisposable
Constructors
MarshalByRefDisposableObject()
Initializes an instance of the class.
protected MarshalByRefDisposableObject()
Properties
IsDisposed
Indicates whether the object has been disposed.
[Browsable(false)]
public bool IsDisposed { get; }
Property Value
- bool:
trueif the object has been disposed; otherwise,false.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)
| Parameter | Type | Description |
|---|---|---|
| disposing | bool |
|
Remarks
This method is called by the public Dispose method and the Finalize method.
Dispose invokes this method with the disposing parameter set to true.
Finalize invokes this method with disposing set to false.
~MarshalByRefDisposableObject()
Allows an object to attempt to free resources and perform other cleanup operations before the object is reclaimed by garbage collection.
protected ~MarshalByRefDisposableObject()
VerifyNotDisposed()
Throws an ObjectDisposedException if the object has already been disposed.
public void VerifyNotDisposed()
Events
Disposed
Occurs when the object is disposed.
Inherited Members
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()