Beispiel #1
0
            /// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.Task"/> associated with this <see cref="TaskAwaiter"/>.</summary>
            /// <param name="continuation">The action to invoke when the await operation completes.</param>
            /// <exception cref="System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception>
            /// <exception cref="System.InvalidOperationException">The awaiter was not properly initialized.</exception>
            /// <remarks>This method is intended for compiler user rather than use directly in code.</remarks>
#if !SILVERLIGHT
            // [SecurityCritical]
#endif
            public void UnsafeOnCompleted(Action continuation)
            {
                TaskAwaiter.OnCompletedInternal(m_task, continuation, m_continueOnCapturedContext);
            }
 /// <summary>
 /// Schedules the continuation onto the <see cref="Task{TResult}"/> associated with this
 /// <see cref="TaskAwaiter{TResult}"/>.
 /// </summary>
 /// <param name="continuation">The action to invoke when the await operation completes.</param>
 /// <exception cref="ArgumentNullException">
 /// If <paramref name="continuation"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="NullReferenceException">The awaiter was not properly initialized.</exception>
 /// <remarks>This method is intended for compiler user rather than use directly in code.</remarks>
 public void OnCompleted(Action continuation)
 {
     TaskAwaiter.OnCompletedInternal(_task, continuation, TaskAwaiter.ContinueOnCapturedContextDefault);
 }
Beispiel #3
0
 /// <summary>计划与此 awaiter 相关异步任务的延续操作。</summary>
 /// <param name="continuation"></param>
 public void UnsafeOnCompleted(Action continuation)
 {
     TaskAwaiter.OnCompletedInternal(m_task, continuation, true);
 }
Beispiel #4
0
        /// <summary>Schedules the continuation onto the <see cref="System.Threading.Tasks.Task"/> associated with this <see cref="TaskAwaiter"/>.</summary>
        /// <param name="continuation">The action to invoke when the await operation completes.</param>
        /// <exception cref="System.ArgumentNullException">The <paramref name="continuation"/> argument is null (Nothing in Visual Basic).</exception>
        /// <exception cref="System.InvalidOperationException">The awaiter was not properly initialized.</exception>
        /// <remarks>This method is intended for compiler user rather than use directly in code.</remarks>
#if !SILVERLIGHT
        //[SecurityCritical]
#endif
        public void UnsafeOnCompleted(Action continuation)
        {
            TaskAwaiter.OnCompletedInternal(m_task, continuation, TaskAwaiter.CONTINUE_ON_CAPTURED_CONTEXT_DEFAULT);
        }