Class DisposableWithEvent
This class provides a base class that implements the IDisposable interface as suggested in the .NET documentation using the Disposable pattern. After the object was disposed a Disposed event is raised.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Grid.Collections.ComponentModel
Assembly: Syncfusion.SfGridCommon.WPF.dll
Syntax
public class DisposableWithEvent : Object, IDisposable
Remarks
If you derive from this class, you only need to override the protected Dispose method and check the disposing parameter.
Constructors
DisposableWithEvent()
Declaration
public DisposableWithEvent()
Properties
IsDisposed
Allows to detect if object is disposed or not. True indicates object is disposed, otherwise indicates object is still alive and ready for use.
Declaration
protected bool IsDisposed { get; }
Property Value
Type |
---|
System.Boolean |
IsDisposing
Returns True if object is executing the Dispose() or Dispose(Boolean) method call.
Declaration
public bool IsDisposing { get; }
Property Value
Type |
---|
System.Boolean |
Methods
Dispose()
Releases all resources used by the Component.
Declaration
public void Dispose()
Dispose(Boolean)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Remarks
See the documentation for the System.ComponentModel.Component class and its Dispose member.
OnDisposed(EventArgs)
Raises the Disposed event.
Declaration
protected virtual void OnDisposed(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | An System.EventArgs that contains the event data. |
Events
Disposed
Occurs after the object was disposed.
Declaration
public event EventHandler Disposed
Event Type
Type |
---|
System.EventHandler |