Show / Hide Table of Contents

Class DisposableType

Provides specialized reflection methods for types implementing dispose pattern.

Inheritance
object
DisposableType
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Reflection
Assembly: DotNext.dll
Syntax
public static class DisposableType

Methods

View Source

get_DisposeAsyncMethod(Type)

Gets DisposeAsync method implementing async dispose pattern.

Declaration
public static MethodInfo? get_DisposeAsyncMethod(Type type)
Parameters
Type Name Description
Type type
Returns
Type Description
MethodInfo

Dispose method; or null, if this method doesn't exist.

View Source

get_DisposeMethod(Type)

Gets Dispose method which implements dispose pattern.

Declaration
public static MethodInfo? get_DisposeMethod(Type type)
Parameters
Type Name Description
Type type
Returns
Type Description
MethodInfo

Dispose method; or null, if this method doesn't exist.

Remarks

This method checks whether the type implements IDisposable. If it is then return Dispose() method. Otherwise, return public instance method with name Dispose.

  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾