Event arguments for cancellation support changes
상속: ProgressEventArgs
예제 #1
0
 private void OnCancellableChanged(bool cancellable)
 {
     if (this.CancellationSupportChangedPrivate != null)
     {
         VsThreadingHelper.RunInline(this, VsTaskRunContext.UIThreadNormalPriority,
                                     () =>
         {
             var delegates = this.CancellationSupportChangedPrivate;
             if (delegates != null)
             {
                 CancellationSupportChangedEventArgs args = new CancellationSupportChangedEventArgs(cancellable);
                 delegates(this, args);
                 // Verify that the observer handled it since now easy way of testing
                 // serialized raising and handling of the event across the classes
                 args.CheckHandled();
             }
         });
     }
 }
 private void OnCancellationSupportChanged(object sender, CancellationSupportChangedEventArgs e)
 {
     VsThreadingHelper.RunInline(this.serviceProvider, VsTaskRunContext.UIThreadNormalPriority, () =>
     {
         ChangeCancellability(e.Cancellable);
     });
     // Flag that handled to assist with the verification, otherwise the controller will assert
     e.Handled();
 }
        private void OnCancellationSupportChanged(object sender, CancellationSupportChangedEventArgs e)
        {
            AssertEventHandlerArgsNotNull(sender, e);

            this.cancellableStateChanges++;
            // Satisfy the sequential controller verification code
            e.Handled();
        }
 private void OnCancellableChanged(bool cancellable)
 {
     if (this.CancellationSupportChangedPrivate != null)
     {
         VsThreadingHelper.RunInline(this, VsTaskRunContext.UIThreadNormalPriority,
             () =>
             {
                 var delegates = this.CancellationSupportChangedPrivate;
                 if (delegates != null)
                 {
                     CancellationSupportChangedEventArgs args = new CancellationSupportChangedEventArgs(cancellable);
                     delegates(this, args);
                     // Verify that the observer handled it since now easy way of testing
                     // serialized raising and handling of the event across the classes
                     args.CheckHandled();
                 }
             });
     }
 }