Class Component
A disposable component base class.
public abstract class Component : ComponentBase, IComponent, INotifyPropertyChanged, IDisposable
- Inheritance
-
Component
- Implements
- Derived
- Inherited Members
Constructors
Component()
Initializes a new instance of the Component class.
protected Component()
Component(string?)
Initializes a new instance of the Component class with an immutable name.
protected Component(string? name)
Parameters
namestringThe name.
Properties
DisposeCollector
Gets or sets the disposables.
protected DisposeCollector? DisposeCollector { get; set; }
Property Value
- DisposeCollector
The disposables.
IsDisposed
Gets a value indicating whether this instance is disposed.
protected bool IsDisposed { get; }
Property Value
- bool
trueif this instance is disposed; otherwise,false.
IsDisposing
protected bool IsDisposing { get; }
Property Value
Methods
Dispose()
Releases unmanaged and - optionally - managed resources
[SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification = "False positive.")]
public void Dispose()
Dispose(bool)
Disposes of object resources.
protected virtual void Dispose(bool disposeManagedResources)
Parameters
disposeManagedResourcesboolIf true, managed resources should be disposed of in addition to unmanaged resources.
RemoveAndDispose<T>(ref T)
Dispose a disposable object and set the reference to null. Removes this object from the ToDispose list.
protected void RemoveAndDispose<T>(ref T objectToDispose)
Parameters
objectToDisposeTObject to dispose.
Type Parameters
T
RemoveToDispose<T>(T)
Removes a disposable object to the list of the objects to dispose.
protected void RemoveToDispose<T>(T toDisposeArg)
Parameters
toDisposeArgTTo dispose.
Type Parameters
T
ToDispose<T>(T)
Adds a disposable object to the list of the objects to dispose.
protected T? ToDispose<T>(T toDisposeArg)
Parameters
toDisposeArgTTo dispose.
Returns
- T
Type Parameters
T
Events
Disposing
Occurs when when Dispose is called.
public event EventHandler<EventArgs>? Disposing