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

            AddProgress(progress);
            return(progress.ProgressMonitor);
        }
Esempio n. 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 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);
 }
Esempio n. 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;
		}
Esempio n. 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;
		}
Esempio n. 10
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;
		}
Esempio n. 11
0
 public IProgressMonitor CreateProgressMonitor(CancellationToken cancellationToken = default(CancellationToken))
 {
     ProgressCollector progress = new ProgressCollector(SD.MainThread.SynchronizingObject, cancellationToken);
     AddProgress(progress);
     return progress.ProgressMonitor;
 }
Esempio n. 12
0
 public MonitorImpl(ProgressCollector collector, MonitorImpl parent, double scaleFactor)
 {
     this.collector   = collector;
     this.parent      = parent;
     this.scaleFactor = scaleFactor;
 }
Esempio n. 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();
		}
Esempio n. 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);
		}