public void ErrorsEncountered_ErrorOriginatesWithOneHandler_MultiProgressHasErrorsEncountered()
		{
			var multiProgress = new MultiProgress();
			var statusProgress = new StatusProgress();
			multiProgress.Add(statusProgress);
			var consoleProgress = new ConsoleProgress();
			multiProgress.AddMessageProgress(consoleProgress);
			statusProgress.WriteError("some error happened!");
			Assert.That(multiProgress.ErrorEncountered, Is.True);
		}
		public void ErrorsEncountered_ErrorOriginatesWithMultiProgress_BothHandlersHaveErrorsEncountered()
		{
			var multiProgress = new MultiProgress();
			var statusProgress = new StatusProgress();
			multiProgress.Add(statusProgress);
			var consoleProgress = new ConsoleProgress();
			multiProgress.AddMessageProgress(consoleProgress);
			multiProgress.WriteError("error!");
			Assert.That(consoleProgress.ErrorEncountered, Is.True);
			Assert.That(statusProgress.ErrorEncountered, Is.True);
		}
Example #3
0
        public SyncControlModel(ProjectFolderConfiguration projectFolderConfiguration,
			SyncUIFeatures uiFeatureFlags,
			IChorusUser user)
        {
            _user = user;
            _progress = new MultiProgress();
            StatusProgress = new SimpleStatusProgress();
            _progress.Add(StatusProgress);
            Features = uiFeatureFlags;
            _synchronizer = Synchronizer.FromProjectConfiguration(projectFolderConfiguration, _progress);
            _backgroundWorker = new BackgroundWorker();
            _backgroundWorker.WorkerSupportsCancellation = true;
            _backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_backgroundWorker_RunWorkerCompleted);
            _backgroundWorker.DoWork += worker_DoWork;

            //clients will normally change these
            SyncOptions = new SyncOptions();
            SyncOptions.CheckinDescription = "[" + Application.ProductName + ": " + Application.ProductVersion + "] sync";
            SyncOptions.DoPullFromOthers = true;
            SyncOptions.DoMergeWithOthers = true;
            SyncOptions.RepositorySourcesToTry.AddRange(GetRepositoriesToList().Where(r => r.Enabled));
        }
        /// <summary>
        /// Make folder-browsing controls invisible, and add in some progress controls for the MakeClone procedure:
        /// </summary>
        private void SwitchControlsForCloning()
        {
            panel.Visible = false;
            progressBar.Visible = false;

            var logBox = new LogBox
            {
                Location = new Point(panel.Location.X, panel.Location.Y + 50),
                Width = panel.Width,
                Height = panel.Height - 50,
                Anchor = panel.Anchor,
                ShowCopyToClipboardMenuItem = true,
                ShowDetailsMenuItem = true,
                ShowDiagnosticsMenuItem = true,
                ShowFontMenuItem = true
            };

            var progressIndicator = new SimpleProgressIndicator
            {
                Location = new Point(panel.Location.X, panel.Location.Y + 35),
                Width = panel.Width,
                Height = 10,
                Style = ProgressBarStyle.Marquee,
                Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top,
                MarqueeAnimationSpeed = 50
            };
            #if MONO
            progressIndicator.MarqueeAnimationSpeed = 3000;
            #else
            #endif
            progressIndicator.IndicateUnknownProgress();

            _clonerStatusLabel = new TextBox
            {
                Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right,
                BackColor = SystemColors.Control,
                BorderStyle = BorderStyle.None,
                Font = new Font("Microsoft Sans Serif", 12F, FontStyle.Regular, GraphicsUnit.Point, ((0))),
                Location = panel.Location,
                Multiline = true,
                Name = "_clonerStatusLabel",
                ReadOnly = true,
                Size = new Size(panel.Width, 25)
            };

            Controls.Add(logBox);
            Controls.Add(progressIndicator);
            Controls.Add(_clonerStatusLabel);

            _clonerMultiProgess = new MultiProgress();
            _clonerMultiProgess.AddMessageProgress(logBox);
            logBox.ProgressIndicator = progressIndicator;
            _clonerMultiProgess.ProgressIndicator = progressIndicator;

            _clonerStatusLabel.Text = string.Format(LocalizationManager.GetString("Messages.Getting","Getting {0}..."),RepositoryKindLabel);
        }
Example #5
0
 private void Init(string name)
 {
     Progress = new MultiProgress(new IProgress[] { new ConsoleProgress {ShowVerbose=true}, _stringBuilderProgress });
     RootFolder = new TemporaryFolder("ChorusTest-" + name + "-" + Guid.NewGuid());
 }
 public InternetCloneSettingsModel(string parentDirectoryToPutCloneIn)
 {
     ParentDirectoryToPutCloneIn = parentDirectoryToPutCloneIn;
     _progress = new MultiProgress();
 }
 public InternetCloneSettingsModel()
 {
     _progress = new MultiProgress();
 }
Example #8
0
 public TestEnvironment(string testName, ApiServerType type)
 {
     Local = new RepositorySetup(testName + "-local");
     Remote = new RepositorySetup(testName + "-remote");
     Progress = new ProgressForTest();
     switch (type)
     {
         case ApiServerType.Dummy:
             ApiServer = new DummyApiServerForTest(testName);
             break;
         case ApiServerType.Pull:
             ApiServer = new PullHandlerApiServerForTest(Remote.Repository, Progress);
             break;
         case ApiServerType.Push:
             ApiServer = new PushHandlerApiServerForTest(Remote.Repository, Progress);
             break;
     }
     Label = testName;
     MultiProgress = new MultiProgress(new IProgress[] { new ConsoleProgress { ShowVerbose = true }, Progress });
 }