Table of Contents

Class DisposeObject

Namespace
HelixToolkit.SharpDX
Assembly
HelixToolkit.SharpDX.dll

Base class to handle disposable.

public abstract class DisposeObject : IDisposable
Inheritance
DisposeObject
Implements
Derived
Inherited Members

Properties

IsDisposed

Gets a value indicating whether this instance is disposed.

public bool IsDisposed { get; }

Property Value

bool

true if this instance is disposed; otherwise, false.

RefCount

public int RefCount { get; }

Property Value

int

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

[SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification = "False positive.")]
public void Dispose()

ForceDispose()

Forces the dispose.

public void ForceDispose()

IncRef()

Increase reference counter

public int IncRef()

Returns

int

OnDispose(bool)

Disposes of object resources.

protected virtual void OnDispose(bool disposeManagedResources)

Parameters

disposeManagedResources bool

If true, managed resources should be disposed of in addition to unmanaged resources.

RemoveAndDispose<T>(T)

Dispose a disposable object. Removes this object from this instance..

public static void RemoveAndDispose<T>(T objectToDispose) where T : class, IDisposable

Parameters

objectToDispose T

The object to dispose.

Type Parameters

T

RemoveAndDispose<T>(ref T?)

Dispose a disposable object and set the reference to null. Removes this object from this instance..

public static void RemoveAndDispose<T>(ref T? objectToDispose) where T : class, IDisposable

Parameters

objectToDispose T

Object to dispose.

Type Parameters

T

Set<T>(ref T, T)

protected static bool Set<T>(ref T backingField, T value)

Parameters

backingField T
value T

Returns

bool

Type Parameters

T