Event argument for IProgressController execution completion IProgressEvents
Inheritance: ProgressEventArgs
Exemplo n.º 1
0
        private void OnFinished(ProgressControllerResult result)
        {
            this.IsFinished = true;
            this.ThreadSafeDisposeCancellationTokenSource();

            VsThreadingHelper.RunInline(this, VsTaskRunContext.UIThreadNormalPriority, () =>
            {
                ConfigureStepEventListeners(false);

                var delegates = this.FinishedPrivate;
                if (delegates != null)
                {
                    ProgressControllerFinishedEventArgs args = new ProgressControllerFinishedEventArgs(result);
                    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 ControllerFinished(object sender, ProgressControllerFinishedEventArgs e)
        {
            this.IsFinished = true;

            VsThreadingHelper.RunInline(this.serviceProvider, VsTaskRunContext.BackgroundThread, () =>
            {
                // Give the last progress a chance to render
                System.Threading.Thread.Sleep(DelayAfterFinishInMS);
            });
            VsThreadingHelper.RunInline(this.serviceProvider, VsTaskRunContext.UIThreadNormalPriority, () =>
            {
                this.host.Hide();
                ((IDisposable)this).Dispose();
            });
            // Flag that handled to assist with the verification, otherwise the controller will assert
            e.Handled();
        }
        private void OnFinished(object sender, ProgressControllerFinishedEventArgs e)
        {
            AssertEventHandlerArgsNotNull(sender, e);

            this.executionResult = e.Result;
            // Satisfy the sequential controller verification code
            e.Handled();
        }
        private void OnFinished(ProgressControllerResult result)
        {
            this.IsFinished = true;
            this.ThreadSafeDisposeCancellationTokenSource();

            VsThreadingHelper.RunInline(this, VsTaskRunContext.UIThreadNormalPriority, () =>
            {
                ConfigureStepEventListeners(false);

                var delegates = this.FinishedPrivate;
                if (delegates != null)
                {
                    ProgressControllerFinishedEventArgs args = new ProgressControllerFinishedEventArgs(result);
                    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();
                }
            });
        }