void OnProgressAvailable (object sender, ProgressEventArgs e)
		{
			DispatchService.GuiDispatch (() => {
				if (ProgressAvailable != null) {
					ProgressAvailable (sender, e);
				}
			});
		}
		void OnProgressAvailable (object sender, ProgressEventArgs e)
		{
			guiDispatcher (() => {
				if (ProgressAvailable != null) {
					ProgressAvailable (sender, e);
				}
			});
		}
Exemplo n.º 3
0
        void launcher_ProgressAvailable(object sender, NuGet.ProgressEventArgs e)
        {
            loadingMessage = string.Format("{0} ({1}%)", e.Operation, e.PercentComplete);

            if (IsDisposed || !launcher.IsDownloading)
            {
                return;
            }

            tempLogEvents.Enqueue(new NugetLogEventArgs(MessageLevel.Info, loadingMessage));
        }
Exemplo n.º 4
0
 private void OnPackageDownloadProgress(ProgressEventArgs e)
 {
     ProgressAvailable(this, e);
 }
Exemplo n.º 5
0
 private void OnPackageDownloadProgress(object sender, ProgressEventArgs e)
 {
     Log.Debug("Progress of operation '{0}': {1} %", e.Operation, e.PercentComplete);
 }
		void ProgressAvailable (object sender, ProgressEventArgs e)
		{
			if (currentProgressOperation == e.Operation)
				return;

			currentProgressOperation = e.Operation;
			progressMonitor.Log.WriteLine (e.Operation);
		}
Exemplo n.º 7
0
 public void dataService_ProgressAvailable(object sender, ProgressEventArgs e)
 {
     if (e.PercentComplete > 0)
     {
         downloadDialog.SetProgressBarPercent(e.PercentComplete);
     }
 }
		public void Run_ActionDownloadsTwoPackages_DownloadingMessageLoggedOnceForEachDownloadOperationByProgressMonitor ()
		{
			CreateRunner ();
			AddInstallActionWithCustomExecuteAction (() => {
				var repository = new FakePackageRepository ();
				repositoryFactoryEvents.RaiseRepositoryCreatedEvent (new PackageRepositoryFactoryEventArgs (repository));

				var progress = new ProgressEventArgs ("Download1", 100);
				repository.RaiseProgressAvailableEvent (progress);

				progress = new ProgressEventArgs ("Download2", 50);
				repository.RaiseProgressAvailableEvent (progress);

				progress = new ProgressEventArgs ("Download2", 100);
				repository.RaiseProgressAvailableEvent (progress);
			});

			Run ();

			progressMonitor.AssertMessageIsLogged ("Download1");
			progressMonitor.AssertMessageIsLogged ("Download2");
			progressMonitor.AssertMessageIsNotLogged ("Download2" + Environment.NewLine + "Download2");
		}
Exemplo n.º 9
0
        private void ProgressProviderOnProgressAvailable(object sender, ProgressEventArgs args)
        {
            if (_lastPercentComplete == args.PercentComplete) {
                return;
            }
            _lastPercentComplete = args.PercentComplete;

            _logger.Info("{0}: {1}", args.Operation, args.PercentComplete);

            var handler = ProgressAvailable;
            if (handler != null) {
                handler(this, args);
            }
        }
Exemplo n.º 10
0
		public void RaiseProgressAvailableEvent (ProgressEventArgs e)
		{
			if (ProgressAvailable != null) {
				ProgressAvailable (this, e);
			}
		}
 private void handler(object obj, ProgressEventArgs args)
 {
     Console.WriteLine(args.PercentComplete);
 }
Exemplo n.º 12
0
        private void OnProgressAvailable(object sender, ProgressEventArgs e)
        {

            // Bug with nuget? At some point, the percent complete revert to negative going downward
            var percentComplete = e.PercentComplete;
            if (percentComplete > 0 && !isInNegativeMode)
            {
                maxPercentage = percentComplete;
            }

            if (percentComplete < 0 || isInNegativeMode)
            {
                isInNegativeMode = true;
                percentComplete = maxPercentage * 2 + percentComplete + 1;
            }

            // clamp
            percentComplete = percentComplete < 0 ? 0 : percentComplete > 100 ? 100 : percentComplete;

            e = new ProgressEventArgs(e.Operation, percentComplete);

            var handler = ProgressAvailable;
            if (handler != null) handler(sender, e);
        }
Exemplo n.º 13
0
 private void OnPackageDownloadProgress(ProgressEventArgs e)
 {
     ProgressAvailable(this, e);
 }
Exemplo n.º 14
0
 void repository_ProgressAvailable(object sender, ProgressEventArgs e)
 {
     this.addLog(e.Operation + " " + e.PercentComplete.ToString());
 }