Show / Hide Table of Contents

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 Source

SafelyReturn<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 T object after it has been created.

Returns
Type Description
T

An initialised object of type T that can be safely returned.

Type Parameters
Name Description
T

The type of the object to be created. It must be System.IDisposable and have a default constructor.

  • View Source
In This Article
Back to top Copyright © 2021 Dr. Gavin T.D. Greig.