ISynchronizeInvoke.BeginInvoke(Delegate, Object[]) 方法

定義

在建立此物件的執行緒上以非同步方式執行委派。Asynchronously executes the delegate on the thread that created this object.

public:
 IAsyncResult ^ BeginInvoke(Delegate ^ method, cli::array <System::Object ^> ^ args);
public IAsyncResult BeginInvoke (Delegate method, object[] args);
abstract member BeginInvoke : Delegate * obj[] -> IAsyncResult
Public Function BeginInvoke (method As Delegate, args As Object()) As IAsyncResult

參數

method
Delegate

方法的 Delegate,採用包含在 args 中的相同數字和型別的參數。A Delegate to a method that takes parameters of the same number and type that are contained in args.

args
Object[]

做為引數傳遞至指定方法的 Object 型別的陣列。An array of type Object to pass as arguments to the given method. 如果不需要引數,則這個可為 nullThis can be null if no arguments are needed.

傳回

IAsyncResult 介面,表示由呼叫這個方法所啟動的非同步作業 (Asynchronous Operation)。An IAsyncResult interface that represents the asynchronous operation started by calling this method.

備註

method 委派會在建立物件的執行緒上執行,而不是在呼叫 BeginInvoke 的執行緒上執行。The method delegate is executed on the thread that created the object, instead of the thread on which BeginInvoke was called.

委派會以非同步方式呼叫,而這個方法會立即傳回。The delegate is called asynchronously, and this method returns immediately. 您可以從任何執行緒呼叫這個方法。You can call this method from any thread. 如果您需要以這個方法啟動之進程的傳回值,請呼叫 EndInvoke 來取得值。If you need the return value from a process started with this method, call EndInvoke to get the value.

如果您需要同步呼叫委派,請改用 Invoke 方法。If you need to call the delegate synchronously, use the Invoke method instead.

適用於

另請參閱