Ejemplo n.º 1
0
        public IProgressMonitor CreateProgressMonitor(CancellationToken cancellationToken = default(CancellationToken))
        {
            ProgressCollector progress = new ProgressCollector(WorkbenchSingleton.Workbench.SynchronizingObject, cancellationToken);

            AddProgress(progress);
            return(progress.ProgressMonitor);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
0
 public MonitorImpl(ProgressCollector collector, MonitorImpl parent, double scaleFactor)
 {
     this.collector   = collector;
     this.parent      = parent;
     this.scaleFactor = scaleFactor;
 }