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

            AddProgress(progress);
            return(progress.ProgressMonitor);
        }
Beispiel #2
0
 private AsynchronousWaitDialog(string titleName, string defaultTaskName, bool allowCancel)
 {
     this.titleName       = StringParser.Parse(titleName);
     this.defaultTaskName = StringParser.Parse(defaultTaskName ?? "${res:Global.PleaseWait}");
     if (allowCancel)
     {
         this.cancellation = new CancellationTokenSource();
     }
     this.collector = new ProgressCollector(synchronizationHelper, allowCancel ? cancellation.Token : CancellationToken.None);
 }
 private AsynchronousWaitDialog(string titleName, string defaultTaskName, bool allowCancel, Action <IProgressMonitor> asyncOperation)
 {
     this.titleName       = StringParser.Parse(titleName);
     this.defaultTaskName = StringParser.Parse(defaultTaskName ?? "${res:Global.PleaseWait}");
     if (allowCancel)
     {
         this.cancellation = new CancellationTokenSource();
     }
     this.asyncOperation     = asyncOperation;
     this.runningInOwnThread = (asyncOperation == null);
     this.collector          = new ProgressCollector(synchronizationHelper, allowCancel ? cancellation.Token : CancellationToken.None);
 }
 public void AddProgress(ProgressCollector progress)
 {
     if (progress == null)
         throw new ArgumentNullException("progress");
     SD.MainThread.VerifyAccess();
     if (currentProgress != null) {
         currentProgress.ProgressMonitorDisposed -= progress_ProgressMonitorDisposed;
         currentProgress.PropertyChanged -= progress_PropertyChanged;
     }
     waitingProgresses.Push(currentProgress); // push even if currentProgress==null
     SetActiveProgress(progress);
 }
Beispiel #5
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);
 }
Beispiel #6
0
		void SetActiveProgress(ProgressCollector progress)
		{
			SD.MainThread.VerifyAccess();
			currentProgress = progress;
			if (progress == null) {
				statusBar.HideProgress();
				return;
			}
			
			progress.ProgressMonitorDisposed += progress_ProgressMonitorDisposed;
			if (progress.ProgressMonitorIsDisposed) {
				progress_ProgressMonitorDisposed(progress, null);
				return;
			}
			progress.PropertyChanged += progress_PropertyChanged;
		}
Beispiel #7
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;
        }
 public void AddProgress(ProgressCollector progress)
 {
 }
		public IProgressMonitor CreateProgressMonitor(CancellationToken cancellationToken = default(CancellationToken))
		{
			ProgressCollector progress = new ProgressCollector(WorkbenchSingleton.Workbench.SynchronizingObject, cancellationToken);
			AddProgress(progress);
			return progress.ProgressMonitor;
		}
		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;
		}
 public IProgressMonitor CreateProgressMonitor(CancellationToken cancellationToken = default(CancellationToken))
 {
     ProgressCollector progress = new ProgressCollector(SD.MainThread.SynchronizingObject, cancellationToken);
     AddProgress(progress);
     return progress.ProgressMonitor;
 }
Beispiel #12
0
 public MonitorImpl(ProgressCollector collector, MonitorImpl parent, double scaleFactor)
 {
     this.collector   = collector;
     this.parent      = parent;
     this.scaleFactor = scaleFactor;
 }
Beispiel #13
0
			public MonitorImpl(ProgressCollector collector, MonitorImpl parent, double scaleFactor)
			{
				this.collector = collector;
				this.parent = parent;
				this.scaleFactor = scaleFactor;
			}
		public void AddProgress(ProgressCollector progress)
		{
			throw new NotImplementedException();
		}
Beispiel #15
0
		private AsynchronousWaitDialog(string titleName, string defaultTaskName, bool allowCancel)
		{
			this.titleName = StringParser.Parse(titleName);
			this.defaultTaskName = StringParser.Parse(defaultTaskName ?? "${res:Global.PleaseWait}");
			if (allowCancel)
				this.cancellation = new CancellationTokenSource();
			this.collector = new ProgressCollector(synchronizationHelper, allowCancel ? cancellation.Token : CancellationToken.None);
		}