Example #1
0
 /// <summary>
 /// Transitions an <see cref="IAsyncResult"/> instance to mark the operation as ended.
 /// </summary>
 /// <typeparam name="TAsyncResult">The <see cref="AsyncResultBase"/> type expected.</typeparam>
 /// <param name="asyncResult">The <see cref="IAsyncResult"/> to examine.</param>
 /// <returns>The <paramref name="asyncResult"/> cast as the <typeparamref name="TAsyncResult"/> type expected.</returns>
 /// <exception cref="ArgumentNullException"> if <paramref name="asyncResult"/> is null.</exception>
 /// <exception cref="ArgumentException"> if <paramref name="asyncResult"/> is not of type <typeparamref name="TAsyncResult"/>.</exception>
 /// <exception cref="InvalidOperationException"> if <paramref name="asyncResult"/> has been canceled.</exception>
 /// <exception cref="InvalidOperationException"> if <paramref name="asyncResult"/>'s End* method has already been invoked.</exception>
 public static TAsyncResult EndAsyncOperation <TAsyncResult>(IAsyncResult asyncResult) where TAsyncResult : AsyncResultBase
 {
     return(AsyncResultBase.EndAsyncOperation <TAsyncResult>(asyncResult, false));
 }