閱讀英文版本

分享方式:


ContextCallback 代理人

定義

代表要在新的內容中呼叫的方法。

C#
public delegate void ContextCallback(object state);
C#
public delegate void ContextCallback(object? state);
C#
[System.Runtime.InteropServices.ComVisible(true)]
public delegate void ContextCallback(object state);

參數

state
Object

物件,它包含回呼方法所使用的資訊。

屬性

備註

ContextCallbackExecutionContext.RunSecurityContext.Run 方法使用。 ContextCallback 表示在提供的內容中執行的方法。 完成方法執行時,內容會還原至其先前的狀態。

將回呼方法傳遞至 ContextCallback 建構函式,以建立委派。 您的方法必須顯示此處的簽章。

擴充方法

GetMethodInfo(Delegate)

取得表示特定委派所代表之方法的物件。

適用於

產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0