Пример #1
0
        public IProgressMonitor CreateProgressMonitor(CancellationToken cancellationToken = default(CancellationToken))
        {
            ProgressCollector progress = new ProgressCollector(WorkbenchSingleton.Workbench.SynchronizingObject, cancellationToken);

            AddProgress(progress);
            return(progress.ProgressMonitor);
        }
Пример #2
0
 public void AddProgress(ProgressCollector progress)
 {
     if (progress == null)
     {
         throw new ArgumentNullException("progress");
     }
     WorkbenchSingleton.AssertMainThread();
     if (currentProgress != null)
     {
         currentProgress.ProgressMonitorDisposed -= progress_ProgressMonitorDisposed;
         currentProgress.PropertyChanged         -= progress_PropertyChanged;
     }
     waitingProgresses.Push(currentProgress);             // push even if currentProgress==null
     SetActiveProgress(progress);
 }
Пример #3
0
        void SetActiveProgress(ProgressCollector progress)
        {
            WorkbenchSingleton.AssertMainThread();
            currentProgress = progress;
            if (progress == null)
            {
                statusBar.HideProgress();
                return;
            }

            progress.ProgressMonitorDisposed += progress_ProgressMonitorDisposed;
            if (progress.ProgressMonitorIsDisposed)
            {
                progress_ProgressMonitorDisposed(progress, null);
                return;
            }
            progress.PropertyChanged += progress_PropertyChanged;
        }
Пример #4
0
 public MonitorImpl(ProgressCollector collector, MonitorImpl parent, double scaleFactor)
 {
     this.collector   = collector;
     this.parent      = parent;
     this.scaleFactor = scaleFactor;
 }