RuntimeHelpers.CleanupCode 委托

定义

表示在发生异常时要运行的方法。

public: delegate void RuntimeHelpers::CleanupCode(System::Object ^ userData, bool exceptionThrown);
public delegate void RuntimeHelpers.CleanupCode(object? userData, bool exceptionThrown);
[System.Security.SecurityCritical]
public delegate void RuntimeHelpers.CleanupCode(object userData, bool exceptionThrown);
public delegate void RuntimeHelpers.CleanupCode(object userData, bool exceptionThrown);
type RuntimeHelpers.CleanupCode = delegate of obj * bool -> unit
[<System.Security.SecurityCritical>]
type RuntimeHelpers.CleanupCode = delegate of obj * bool -> unit
Public Delegate Sub RuntimeHelpers.CleanupCode(userData As Object, exceptionThrown As Boolean)

参数

userData
Object

要传递给委托的数据。

exceptionThrown
Boolean

true 表示引发了异常;如果未引发异常,则为 false

属性

注解

RuntimeHelpers.CleanupCode 委托与 方法一起使用 ExecuteCodeWithGuaranteedCleanup

扩展方法

GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。

适用于