TaskFactory.FromAsync メソッド
定義
オーバーロード
FromAsync(IAsyncResult, Action<IAsyncResult>) |
指定された Task の完了時に終了メソッド アクションを実行する IAsyncResult を作成します。Creates a Task that executes an end method action when a specified IAsyncResult completes. |
FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync(IAsyncResult, Action<IAsyncResult>, TaskCreationOptions) |
指定された Task の完了時に終了メソッド アクションを実行する IAsyncResult を作成します。Creates a Task that executes an end method action when a specified IAsyncResult completes. |
FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync(IAsyncResult, Action<IAsyncResult>, TaskCreationOptions, TaskScheduler) |
指定された Task の完了時に終了メソッド アクションを実行する IAsyncResult を作成します。Creates a Task that executes an end method action when a specified IAsyncResult completes. |
FromAsync<TArg1,TArg2,TArg3,TResult>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2,TArg3,TResult>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, TArg3, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2,TResult>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2,TResult>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TResult>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1,TResult>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task を作成します。Creates a Task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TResult>(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) |
指定された Task<TResult> の完了時に終了メソッド関数を実行する IAsyncResult を作成します。Creates a Task<TResult> that executes an end method function when a specified IAsyncResult completes. |
FromAsync<TResult>(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) |
指定された Task<TResult> の完了時に終了メソッド関数を実行する IAsyncResult を作成します。Creates a Task<TResult> that executes an end method function when a specified IAsyncResult completes. |
FromAsync<TResult>(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync<TResult>(IAsyncResult, Func<IAsyncResult,TResult>) |
指定された Task<TResult> の完了時に終了メソッド関数を実行する IAsyncResult を作成します。Creates a Task<TResult> that executes an end method function when a specified IAsyncResult completes. |
FromAsync<TResult>(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) |
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. |
FromAsync(IAsyncResult, Action<IAsyncResult>)
指定された Task の完了時に終了メソッド アクションを実行する IAsyncResult を作成します。Creates a Task that executes an end method action when a specified IAsyncResult completes.
public:
System::Threading::Tasks::Task ^ FromAsync(IAsyncResult ^ asyncResult, Action<IAsyncResult ^> ^ endMethod);
public System.Threading.Tasks.Task FromAsync (IAsyncResult asyncResult, Action<IAsyncResult> endMethod);
member this.FromAsync : IAsyncResult * Action<IAsyncResult> -> System.Threading.Tasks.Task
Public Function FromAsync (asyncResult As IAsyncResult, endMethod As Action(Of IAsyncResult)) As Task
パラメーター
- asyncResult
- IAsyncResult
完了時に endMethod
の処理が開始される IAsyncResult。The IAsyncResult whose completion should trigger the processing of the endMethod
.
- endMethod
- Action<IAsyncResult>
完了した asyncResult
を処理するアクション デリゲート。The action delegate that processes the completed asyncResult
.
戻り値
非同期操作を表す Task。A Task that represents the asynchronous operation.
例外
asyncResult
は null
です。asyncResult
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
ヒント
FromAsyncパラメーターを受け取るオーバーロードは、 asyncResult
パラメーターを受け取るオーバーロードほど効率的ではありません beginMethod
。The FromAsync overloads that take an asyncResult
parameter are not as efficient as the overloads that take a beginMethod
parameter. パフォーマンスが問題になる場合は、パターンを提供するオーバーロードを使用し beginMethod
/ endMethod
ます。If performance is an issue, use the overloads that provide the beginMethod
/endMethod
pattern.
適用対象
FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object)
public:
System::Threading::Tasks::Task ^ FromAsync(Func<AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, System::Object ^ state);
public System.Threading.Tasks.Task FromAsync (Func<AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, object state);
public System.Threading.Tasks.Task FromAsync (Func<AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, object? state);
member this.FromAsync : Func<AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * obj -> System.Threading.Tasks.Task
Public Function FromAsync (beginMethod As Func(Of AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), state As Object) As Task
パラメーター
- beginMethod
- Func<AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync(IAsyncResult, Action<IAsyncResult>, TaskCreationOptions)
指定された Task の完了時に終了メソッド アクションを実行する IAsyncResult を作成します。Creates a Task that executes an end method action when a specified IAsyncResult completes.
public:
System::Threading::Tasks::Task ^ FromAsync(IAsyncResult ^ asyncResult, Action<IAsyncResult ^> ^ endMethod, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync (IAsyncResult asyncResult, Action<IAsyncResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : IAsyncResult * Action<IAsyncResult> * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task
Public Function FromAsync (asyncResult As IAsyncResult, endMethod As Action(Of IAsyncResult), creationOptions As TaskCreationOptions) As Task
パラメーター
- asyncResult
- IAsyncResult
完了時に endMethod
の処理が開始される IAsyncResult。The IAsyncResult whose completion should trigger the processing of the endMethod
.
- endMethod
- Action<IAsyncResult>
完了した asyncResult
を処理するアクション デリゲート。The action delegate that processes the completed asyncResult
.
- creationOptions
- TaskCreationOptions
作成された Task の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task.
戻り値
非同期操作を表す Task。A Task that represents the asynchronous operation.
例外
asyncResult
は null
です。asyncResult
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
paramref name="creationOptions" /> で無効な TaskCreationOptions 値が指定されています。paramref name="creationOptions" /> specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
ヒント
FromAsyncパラメーターを受け取るオーバーロードは、 asyncResult
パラメーターを受け取るオーバーロードほど効率的ではありません beginMethod
。The FromAsync overloads that take an asyncResult
parameter are not as efficient as the overloads that take a beginMethod
parameter. パフォーマンスが問題になる場合は、パターンを提供するオーバーロードを使用し beginMethod
/ endMethod
ます。If performance is an issue, use the overloads that provide the beginMethod
/endMethod
pattern.
適用対象
FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
public:
System::Threading::Tasks::Task ^ FromAsync(Func<AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync (Func<AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync (Func<AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task
Public Function FromAsync (beginMethod As Func(Of AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), state As Object, creationOptions As TaskCreationOptions) As Task
パラメーター
- beginMethod
- Func<AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
. TaskCreationOptions値、 PreferFairness LongRunning およびは、 AttachedToParent すべて相互に排他的です。The TaskCreationOptions values PreferFairness, LongRunning and AttachedToParent are all mutually exclusive. FromAsync メソッドで LongRunning
は、または AttachedToParent
自体によってが ArgumentOutOfRangeException スローされます。In the FromAsync methods, either LongRunning
or AttachedToParent
by themselves will cause an ArgumentOutOfRangeException to be thrown.
適用対象
FromAsync(IAsyncResult, Action<IAsyncResult>, TaskCreationOptions, TaskScheduler)
指定された Task の完了時に終了メソッド アクションを実行する IAsyncResult を作成します。Creates a Task that executes an end method action when a specified IAsyncResult completes.
public:
System::Threading::Tasks::Task ^ FromAsync(IAsyncResult ^ asyncResult, Action<IAsyncResult ^> ^ endMethod, System::Threading::Tasks::TaskCreationOptions creationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task FromAsync (IAsyncResult asyncResult, Action<IAsyncResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.FromAsync : IAsyncResult * Action<IAsyncResult> * System.Threading.Tasks.TaskCreationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task
Public Function FromAsync (asyncResult As IAsyncResult, endMethod As Action(Of IAsyncResult), creationOptions As TaskCreationOptions, scheduler As TaskScheduler) As Task
パラメーター
- asyncResult
- IAsyncResult
完了時に endMethod
の処理が開始される IAsyncResult。The IAsyncResult whose completion should trigger the processing of the endMethod
.
- endMethod
- Action<IAsyncResult>
完了した asyncResult
を処理するアクション デリゲート。The action delegate that processes the completed asyncResult
.
- creationOptions
- TaskCreationOptions
作成された Task の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task.
- scheduler
- TaskScheduler
終了メソッドを実行するタスクをスケジュールするときに使用する TaskScheduler。The TaskScheduler that is used to schedule the task that executes the end method.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
asyncResult
は null
です。asyncResult
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
または-or-
scheduler
は null
です。scheduler
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
ヒント
FromAsyncパラメーターを受け取るオーバーロードは、 asyncResult
パラメーターを受け取るオーバーロードほど効率的ではありません beginMethod
。The FromAsync overloads that take an asyncResult
parameter are not as efficient as the overloads that take a beginMethod
parameter. パフォーマンスが問題になる場合は、パターンを提供するオーバーロードを使用し beginMethod
/ endMethod
ます。If performance is an issue, use the overloads that provide the beginMethod
/endMethod
pattern.
適用対象
FromAsync<TArg1,TArg2,TArg3,TResult>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TArg1, typename TArg2, typename TArg3, typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, TArg3, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TArg3,TResult> (Func<TArg1,TArg2,TArg3,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TArg3,TResult> (Func<TArg1,TArg2,TArg3,AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, 'TArg2, 'TArg3, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * 'TArg3 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2, TArg3, TResult) (beginMethod As Func(Of TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, arg3 As TArg3, state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 3 引数の型。The type of the third argument passed to beginMethod
delegate.
- TArg3
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- arg3
- TArg3
beginMethod
デリゲートに渡される第 3 引数。The third argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task<TResult> の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task<TResult>.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2,TArg3,TResult>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TArg1, typename TArg2, typename TArg3, typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, TArg3, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TArg3,TResult> (Func<TArg1,TArg2,TArg3,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TArg3,TResult> (Func<TArg1,TArg2,TArg3,AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state);
member this.FromAsync : Func<'TArg1, 'TArg2, 'TArg3, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * 'TArg3 * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2, TArg3, TResult) (beginMethod As Func(Of TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, arg3 As TArg3, state As Object) As Task(Of TResult)
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 3 引数の型。The type of the third argument passed to beginMethod
delegate.
- TArg3
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- arg3
- TArg3
beginMethod
デリゲートに渡される第 3 引数。The third argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions)
public:
generic <typename TArg1, typename TArg2, typename TArg3>
System::Threading::Tasks::Task ^ FromAsync(Func<TArg1, TArg2, TArg3, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2,TArg3> (Func<TArg1,TArg2,TArg3,AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2,TArg3> (Func<TArg1,TArg2,TArg3,AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, 'TArg2, 'TArg3, AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * 'TArg1 * 'TArg2 * 'TArg3 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task
Public Function FromAsync(Of TArg1, TArg2, TArg3) (beginMethod As Func(Of TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), arg1 As TArg1, arg2 As TArg2, arg3 As TArg3, state As Object, creationOptions As TaskCreationOptions) As Task
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 3 引数の型。The type of the third argument passed to beginMethod
delegate.
- TArg3
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
パラメーター
- beginMethod
- Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- arg3
- TArg3
beginMethod
デリゲートに渡される第 3 引数。The third argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, TArg3, Object)
public:
generic <typename TArg1, typename TArg2, typename TArg3>
System::Threading::Tasks::Task ^ FromAsync(Func<TArg1, TArg2, TArg3, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, System::Object ^ state);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2,TArg3> (Func<TArg1,TArg2,TArg3,AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object state);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2,TArg3> (Func<TArg1,TArg2,TArg3,AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state);
member this.FromAsync : Func<'TArg1, 'TArg2, 'TArg3, AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * 'TArg1 * 'TArg2 * 'TArg3 * obj -> System.Threading.Tasks.Task
Public Function FromAsync(Of TArg1, TArg2, TArg3) (beginMethod As Func(Of TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), arg1 As TArg1, arg2 As TArg2, arg3 As TArg3, state As Object) As Task
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 3 引数の型。The type of the third argument passed to beginMethod
delegate.
- TArg3
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
パラメーター
- beginMethod
- Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- arg3
- TArg3
beginMethod
デリゲートに渡される第 3 引数。The third argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2,TResult>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TArg1, typename TArg2, typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TResult> (Func<TArg1,TArg2,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, object state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TResult> (Func<TArg1,TArg2,AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state);
member this.FromAsync : Func<'TArg1, 'TArg2, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2, TResult) (beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, state As Object) As Task(Of TResult)
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2,TResult>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TArg1, typename TArg2, typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TResult> (Func<TArg1,TArg2,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TResult> (Func<TArg1,TArg2,AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, 'TArg2, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2, TResult) (beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task<TResult> の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task<TResult>.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, Object)
public:
generic <typename TArg1, typename TArg2>
System::Threading::Tasks::Task ^ FromAsync(Func<TArg1, TArg2, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, TArg1 arg1, TArg2 arg2, System::Object ^ state);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2> (Func<TArg1,TArg2,AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object state);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2> (Func<TArg1,TArg2,AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object? state);
member this.FromAsync : Func<'TArg1, 'TArg2, AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * 'TArg1 * 'TArg2 * obj -> System.Threading.Tasks.Task
Public Function FromAsync(Of TArg1, TArg2) (beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), arg1 As TArg1, arg2 As TArg2, state As Object) As Task
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
パラメーター
- beginMethod
- Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, Object, TaskCreationOptions)
public:
generic <typename TArg1, typename TArg2>
System::Threading::Tasks::Task ^ FromAsync(Func<TArg1, TArg2, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, TArg1 arg1, TArg2 arg2, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2> (Func<TArg1,TArg2,AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync<TArg1,TArg2> (Func<TArg1,TArg2,AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, 'TArg2, AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * 'TArg1 * 'TArg2 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task
Public Function FromAsync(Of TArg1, TArg2) (beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), arg1 As TArg1, arg2 As TArg2, state As Object, creationOptions As TaskCreationOptions) As Task
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 2 引数の型。The type of the second argument passed to beginMethod
delegate.
- TArg2
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
パラメーター
- beginMethod
- Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- arg2
- TArg2
beginMethod
デリゲートに渡される第 2 引数。The second argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TResult>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TArg1, typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TResult> (Func<TArg1,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, object state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TResult> (Func<TArg1,AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, object? state);
member this.FromAsync : Func<'TArg1, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TResult) (beginMethod As Func(Of TArg1, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, state As Object) As Task(Of TResult)
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<TArg1,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1,TResult>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TArg1, typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TResult> (Func<TArg1,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TResult> (Func<TArg1,AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TResult) (beginMethod As Func(Of TArg1, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<TArg1,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task<TResult> の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task<TResult>.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, Object, TaskCreationOptions)
public:
generic <typename TArg1>
System::Threading::Tasks::Task ^ FromAsync(Func<TArg1, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, TArg1 arg1, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync<TArg1> (Func<TArg1,AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task FromAsync<TArg1> (Func<TArg1,AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * 'TArg1 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task
Public Function FromAsync(Of TArg1) (beginMethod As Func(Of TArg1, AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), arg1 As TArg1, state As Object, creationOptions As TaskCreationOptions) As Task
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
パラメーター
- beginMethod
- Func<TArg1,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, TArg1, Object)
public:
generic <typename TArg1>
System::Threading::Tasks::Task ^ FromAsync(Func<TArg1, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Action<IAsyncResult ^> ^ endMethod, TArg1 arg1, System::Object ^ state);
public System.Threading.Tasks.Task FromAsync<TArg1> (Func<TArg1,AsyncCallback,object,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, object state);
public System.Threading.Tasks.Task FromAsync<TArg1> (Func<TArg1,AsyncCallback,object?,IAsyncResult> beginMethod, Action<IAsyncResult> endMethod, TArg1 arg1, object? state);
member this.FromAsync : Func<'TArg1, AsyncCallback, obj, IAsyncResult> * Action<IAsyncResult> * 'TArg1 * obj -> System.Threading.Tasks.Task
Public Function FromAsync(Of TArg1) (beginMethod As Func(Of TArg1, AsyncCallback, Object, IAsyncResult), endMethod As Action(Of IAsyncResult), arg1 As TArg1, state As Object) As Task
型パラメーター
- TArg1
beginMethod
デリゲートに渡される第 1 引数の型。The type of the first argument passed to the beginMethod
delegate.
パラメーター
- beginMethod
- Func<TArg1,AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Action<IAsyncResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- arg1
- TArg1
beginMethod
デリゲートに渡される第 1 引数。The first argument passed to the beginMethod
delegate.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task。The created Task that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
デリゲートは、で実行されている beginMethod
スレッドで開始され FromAsync ます。The beginMethod
delegate is started on the thread that FromAsync is running on. このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TResult>(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler)
指定された Task<TResult> の完了時に終了メソッド関数を実行する IAsyncResult を作成します。Creates a Task<TResult> that executes an end method function when a specified IAsyncResult completes.
public:
generic <typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(IAsyncResult ^ asyncResult, Func<IAsyncResult ^, TResult> ^ endMethod, System::Threading::Tasks::TaskCreationOptions creationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (IAsyncResult asyncResult, Func<IAsyncResult,TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.FromAsync : IAsyncResult * Func<IAsyncResult, 'Result> * System.Threading.Tasks.TaskCreationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TResult) (asyncResult As IAsyncResult, endMethod As Func(Of IAsyncResult, TResult), creationOptions As TaskCreationOptions, scheduler As TaskScheduler) As Task(Of TResult)
型パラメーター
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- asyncResult
- IAsyncResult
完了時に endMethod
の処理が開始される IAsyncResult。The IAsyncResult whose completion should trigger the processing of the endMethod
.
- endMethod
- Func<IAsyncResult,TResult>
完了した asyncResult
を処理する関数デリゲート。The function delegate that processes the completed asyncResult
.
- creationOptions
- TaskCreationOptions
作成された Task<TResult> の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task<TResult>.
- scheduler
- TaskScheduler
終了メソッドを実行するタスクをスケジュールするときに使用する TaskScheduler。The TaskScheduler that is used to schedule the task that executes the end method.
戻り値
非同期操作を表す Task<TResult>。A Task<TResult> that represents the asynchronous operation.
例外
asyncResult
は null
です。asyncResult
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
または-or-
scheduler
は null
です。scheduler
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
ヒント
FromAsyncパラメーターを受け取るオーバーロードは、 asyncResult
パラメーターを受け取るオーバーロードほど効率的ではありません beginMethod
。The FromAsync overloads that take an asyncResult
parameter are not as efficient as the overloads that take a beginMethod
parameter. パフォーマンスが問題になる場合は、パターンを提供するオーバーロードを使用し beginMethod
/ endMethod
ます。If performance is an issue, use the overloads that provide the beginMethod
/endMethod
pattern.
適用対象
FromAsync<TResult>(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions)
指定された Task<TResult> の完了時に終了メソッド関数を実行する IAsyncResult を作成します。Creates a Task<TResult> that executes an end method function when a specified IAsyncResult completes.
public:
generic <typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(IAsyncResult ^ asyncResult, Func<IAsyncResult ^, TResult> ^ endMethod, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (IAsyncResult asyncResult, Func<IAsyncResult,TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : IAsyncResult * Func<IAsyncResult, 'Result> * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TResult) (asyncResult As IAsyncResult, endMethod As Func(Of IAsyncResult, TResult), creationOptions As TaskCreationOptions) As Task(Of TResult)
型パラメーター
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- asyncResult
- IAsyncResult
完了時に endMethod
の処理が開始される IAsyncResult。The IAsyncResult whose completion should trigger the processing of the endMethod
.
- endMethod
- Func<IAsyncResult,TResult>
完了した asyncResult
を処理する関数デリゲート。The function delegate that processes the completed asyncResult
.
- creationOptions
- TaskCreationOptions
作成された Task<TResult> の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task<TResult>.
戻り値
非同期操作を表す Task<TResult>。A Task<TResult> that represents the asynchronous operation.
例外
asyncResult
は null
です。asyncResult
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
ヒント
FromAsyncパラメーターを受け取るオーバーロードは、 asyncResult
パラメーターを受け取るオーバーロードほど効率的ではありません beginMethod
。The FromAsync overloads that take an asyncResult
parameter are not as efficient as the overloads that take a beginMethod
parameter. パフォーマンスが問題になる場合は、パターンを提供するオーバーロードを使用し beginMethod
/ endMethod
ます。If performance is an issue, use the overloads that provide the beginMethod
/endMethod
pattern.
適用対象
FromAsync<TResult>(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (Func<AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, object state);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (Func<AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, object? state);
member this.FromAsync : Func<AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TResult) (beginMethod As Func(Of AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), state As Object) As Task(Of TResult)
型パラメーター
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.
適用対象
FromAsync<TResult>(IAsyncResult, Func<IAsyncResult,TResult>)
指定された Task<TResult> の完了時に終了メソッド関数を実行する IAsyncResult を作成します。Creates a Task<TResult> that executes an end method function when a specified IAsyncResult completes.
public:
generic <typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(IAsyncResult ^ asyncResult, Func<IAsyncResult ^, TResult> ^ endMethod);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (IAsyncResult asyncResult, Func<IAsyncResult,TResult> endMethod);
member this.FromAsync : IAsyncResult * Func<IAsyncResult, 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TResult) (asyncResult As IAsyncResult, endMethod As Func(Of IAsyncResult, TResult)) As Task(Of TResult)
型パラメーター
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- asyncResult
- IAsyncResult
完了時に endMethod
の処理が開始される IAsyncResult。The IAsyncResult whose completion should trigger the processing of the endMethod
.
- endMethod
- Func<IAsyncResult,TResult>
完了した asyncResult
を処理する関数デリゲート。The function delegate that processes the completed asyncResult
.
戻り値
非同期操作を表す Task<TResult>。A Task<TResult> that represents the asynchronous operation.
例外
asyncResult
は null
です。asyncResult
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
注釈
ヒント
FromAsyncパラメーターを受け取るオーバーロードは、 asyncResult
パラメーターを受け取るオーバーロードほど効率的ではありません beginMethod
。The FromAsync overloads that take an asyncResult
parameter are not as efficient as the overloads that take a beginMethod
parameter. パフォーマンスが問題になる場合は、パターンを提供するオーバーロードを使用し beginMethod
/ endMethod
ます。If performance is an issue, use the overloads that provide the beginMethod
/endMethod
pattern.
適用対象
FromAsync<TResult>(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions)
非同期プログラミング モデルのパターンに準拠した開始メソッドと終了メソッドの組み合わせを表す Task<TResult> を作成します。Creates a Task<TResult> that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.
public:
generic <typename TResult>
System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (Func<AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TResult> (Func<AsyncCallback,object?,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TResult) (beginMethod As Func(Of AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)
型パラメーター
- TResult
タスクで使用できる結果の型。The type of the result available through the task.
パラメーター
- beginMethod
- Func<AsyncCallback,Object,IAsyncResult>
非同期操作を開始するデリゲート。The delegate that begins the asynchronous operation.
- endMethod
- Func<IAsyncResult,TResult>
非同期操作を終了するデリゲート。The delegate that ends the asynchronous operation.
- state
- Object
beginMethod
デリゲートによって使用されるデータを格納しているオブジェクト。An object containing data to be used by the beginMethod
delegate.
- creationOptions
- TaskCreationOptions
作成された Task<TResult> の動作を制御する TaskCreationOptions 値。The TaskCreationOptions value that controls the behavior of the created Task<TResult>.
戻り値
非同期操作を表す作成された Task<TResult>。The created Task<TResult> that represents the asynchronous operation.
例外
beginMethod
は null
です。beginMethod
is null
.
または-or-
endMethod
は null
です。endMethod
is null
.
creationOptions
に無効な TaskCreationOptions 値が指定されています。creationOptions
specifies an invalid TaskCreationOptions value. 詳細については、FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions) の「解説」を参照してください。For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions)
注釈
このメソッドは、によってスローされた例外をスロー beginMethod
します。This method throws any exceptions thrown by the beginMethod
.