Class Disposable
Contains a method that supports the correct usage of System.IDisposable objects.
Inheritance
System.Object
Disposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Existential
Assembly: Existential.Net.dll
Syntax
public static class Disposable
Methods
View SourceSafelyReturn<T>(Action<T>)
Creates and initialises an System.IDisposable object of type
T
using best practices so that it can be safely returned without
violating Code Analysis rule CA2000.
Declaration
public static T SafelyReturn<T>(Action<T> inInitialiser = null)
where T : class, IDisposable, new()
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | inInitialiser | An System.Action that initialises a type |
Returns
Type | Description |
---|---|
T | An initialised object of type |
Type Parameters
Name | Description |
---|---|
T | The type of the object to be created. It must be System.IDisposable and have a default constructor. |