DisposableUtil

Description

static class Tinman.Core.System.DisposableUtil
<T ref : IDisposable>

Provides static helper method for dealing with IDisposables.

Public / Methods

Cast


[OwnerReturn]
public static method Cast → (1)

disposable in : object

The disposable object or null.

returns → T

disposable in if a strong reference of the given type has been acquired, null if the object is no longer valid or is of an incompatible type.

Returns a strong reference of the given type to the given disposable object.

Cast​Own


[OwnerReturn]
public static method CastOwn → (1)

disposable in : IDisposable own

The disposable object or null.

returns → T

disposable in if a strong reference of the given type has been acquired, null if the object is no longer valid or is of an incompatible type.

Returns a strong reference of the given type to the given disposable object.

Dispose


[Dispose]
public static method Dispose → (1)

disposable in : T own

The object or null.

Disposes the given object.

Dispose​All

3 overloads


[Dispose]
public static method DisposeAll1 → (1)

disposables in : T [ ] own

The objects to dispose.

Disposes all given objects and sets the corresponding array elements to null.

The variable that holds the given disposables in must be cleared to null after this method has returned in order to guarantee correct resource management.


[Dispose]
public static method DisposeAll2 → (1)

disposables in : IVector<T> own

The objects to dispose.

Disposes all given objects and sets the corresponding array elements to null.

The variable that holds the given disposables in must be cleared to null after this method has returned in order to guarantee correct resource management.


[Dispose]
public static method DisposeAll3 → (1)

disposables in : IEnumerable<T> own

The objects to dispose.

Disposes all given objects.

The variable that holds the given disposables in must be cleared to null after this method has returned in order to guarantee correct resource management.

Dispose​On​Exit


public static method DisposeOnExit → (1)

disposable in : T own

The object to dispose.

returns → T

disposable in

Disposes the given object when the enclosing process exits.

This method is intended to be used in very specific cases and should not be used commonly.

Is​Disposed


public static method IsDisposed → (1)

disposable in : T

The disposable object.

returns → bool

true if disposable in is no longer valid, false if it still is.

Tests if the given object is no longer valid (i.e. it has left the LifecycleState.Initialized state).