ISynchronizeInvoke.InvokeRequired 屬性

定義

取得值,表示當呼叫實作這個介面的物件時,呼叫端是否必須呼叫 Invoke(Delegate, Object[])Gets a value indicating whether the caller must call Invoke(Delegate, Object[]) when calling an object that implements this interface.

public:
 property bool InvokeRequired { bool get(); };
public bool InvokeRequired { get; }
member this.InvokeRequired : bool
Public ReadOnly Property InvokeRequired As Boolean

屬性值

Boolean

如果呼叫端必須呼叫 Invoke(Delegate, Object[]),則為 true,否則為 falsetrue if the caller must call Invoke(Delegate, Object[]); otherwise, false.

備註

這個屬性會判斷呼叫者 Invoke 對執行此介面的物件進行方法呼叫時,是否必須呼叫。This property determines whether the caller must call Invoke when making method calls to an object that implements this interface. 這類物件會系結至特定的執行緒,而且不是安全線程。Such objects are bound to a specific thread and are not thread-safe. 如果您從不同的執行緒呼叫方法,您必須使用方法,將 Invoke 呼叫封送處理至適當的執行緒。If you are calling a method from a different thread, you must use the Invoke method to marshal the call to the proper thread.

適用於