Changeset 16317
- Timestamp:
- 11/22/18 12:37:04 (6 years ago)
- Location:
- branches/2845_EnhancedProgress
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2845_EnhancedProgress/HeuristicLab.Analysis.Statistics.Views/3.3/ChartAnalysisView.cs
r16311 r16317 173 173 174 174 private void addLineToChart_Click(object sender, EventArgs e) { 175 Progress.Show Marquee(this, "Adding fitted lines to charts...");175 Progress.Show(this, "Adding fitted lines to charts...", ProgressMode.Indeterminate); 176 176 177 177 string resultName = (string)dataTableComboBox.SelectedItem; -
branches/2845_EnhancedProgress/HeuristicLab.Analysis.Statistics.Views/3.3/StatisticalTestsView.cs
r16311 r16317 356 356 357 357 if (data != null && data.All(x => x != null)) { 358 Progress.Show Marquee(this, "Calculating...");358 Progress.Show(this, "Calculating...", ProgressMode.Indeterminate); 359 359 360 360 string curItem = (string)groupCompComboBox.SelectedItem; … … 376 376 return; 377 377 378 Progress.Show Marquee(pairwiseTestGroupBox, "Calculating...");378 Progress.ShowOnControl(pairwiseTestGroupBox, "Calculating...", ProgressMode.Indeterminate); 379 379 Task.Factory.StartNew(() => CalculatePairwiseAsync(groupName)); 380 380 } … … 383 383 CalculatePairwiseTest(groupName); 384 384 385 Progress.Hide (pairwiseTestGroupBox);385 Progress.HideFromControl(pairwiseTestGroupBox); 386 386 } 387 387 -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Access.Views/3.3/ClientViews/ClientView.cs
r16311 r16317 77 77 public void StartProgressView() { 78 78 var message = "Downloading client information. Please be patient."; 79 Progress.Show Marquee(this, message);79 Progress.Show(this, message, ProgressMode.Indeterminate); 80 80 } 81 81 -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectJobsView.cs
r16314 r16317 139 139 140 140 private void refreshButton_Click(object sender, EventArgs e) { 141 progress.Start Marquee("Refreshing jobs...");141 progress.Start("Refreshing jobs...", ProgressMode.Indeterminate); 142 142 SetEnabledStateOfControls(); 143 143 var task = System.Threading.Tasks.Task.Factory.StartNew(RefreshJobsAsync); … … 160 160 161 161 if (result == DialogResult.Yes) { 162 progress.Start Marquee("Removing job(s)...");162 progress.Start("Removing job(s)...", ProgressMode.Indeterminate); 163 163 SetEnabledStateOfControls(); 164 164 var task = System.Threading.Tasks.Task.Factory.StartNew(RemoveJobsAsync, jobs); … … 191 191 192 192 if (result == DialogResult.Yes) { 193 progress.Start Marquee("Resuming job(s)...");193 progress.Start("Resuming job(s)...", ProgressMode.Indeterminate); 194 194 SetEnabledStateOfControls(); 195 195 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobsAsync, jobs); … … 253 253 254 254 if (result == DialogResult.Yes) { 255 progress.Start Marquee("Stopping job(s)...");255 progress.Start("Stopping job(s)...", ProgressMode.Indeterminate); 256 256 SetEnabledStateOfControls(); 257 257 var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobsAsync, jobs); … … 390 390 private void RemoveJobsAsync(object jobs) { 391 391 var jobList = (IEnumerable<RefreshableJob>)jobs; 392 progress.Start Marquee("");392 progress.Start("", ProgressMode.Indeterminate); 393 393 foreach (var job in jobList) { 394 394 progress.Message = "Removing job \"" + job.Job.Name + "\"..."; -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs
r16312 r16317 161 161 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 162 162 else { 163 Progress.Show Marquee(this, "Refreshing ...");163 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 164 164 SetEnabledStateOfControls(); 165 165 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.cs
r16312 r16317 183 183 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 184 184 else { 185 Progress.Show Marquee(this, "Refreshing ...");185 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 186 186 SetEnabledStateOfControls(); 187 187 } … … 199 199 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 200 200 else { 201 Progress.Show Marquee(this, "Refreshing ...");201 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 202 202 SetEnabledStateOfControls(); 203 203 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
r16312 r16317 185 185 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 186 186 else { 187 Progress.Show Marquee(this, "Refreshing ...");187 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 188 188 SetEnabledStateOfControls(); 189 189 } … … 201 201 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 202 202 else { 203 Progress.Show Marquee(this, "Refreshing ...");203 Progress.Show(this, "Refreshing ...", ProgressMode.Indeterminate); 204 204 SetEnabledStateOfControls(); 205 205 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs
r16311 r16317 99 99 rJob.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList(); 100 100 101 progress = Progress.Show Marquee(this.content, "Uploading to Hive...");101 progress = Progress.Show(this.content, "Uploading to Hive...", ProgressMode.Indeterminate); 102 102 rJob.Progress = progress; 103 103 progress.ProgressStateChanged += progress_ProgressStateChanged; -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r16312 r16317 96 96 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshing, sender, e); 97 97 else { 98 Progress.Show Marquee(this, "Refreshing");98 Progress.ShowOnControl(this, "Refreshing", ProgressMode.Indeterminate); 99 99 refreshButton.Enabled = false; 100 100 } … … 104 104 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshed, sender, e); 105 105 else { 106 Progress.Hide (this);106 Progress.HideFromControl(this); 107 107 refreshButton.Enabled = true; 108 108 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r16312 r16317 131 131 132 132 private void DeleteHiveJobsAsync(object items) { 133 Progress.Show Marquee(this, "Deleting job...");133 Progress.Show(this, "Deleting job...", ProgressMode.Indeterminate); 134 134 foreach (RefreshableJob item in (List<RefreshableJob>)items) { 135 135 Content.Remove(item); -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r16314 r16317 493 493 494 494 private void PauseJobAsync(object job) { 495 Content.Progress.Start Marquee("Pausing job...");495 Content.Progress.Start("Pausing job...", ProgressMode.Indeterminate); 496 496 HiveClient.PauseJob((RefreshableJob)job); 497 497 Content.Progress.Finish(); … … 499 499 500 500 private void StopJobAsync(object job) { 501 Content.Progress.Start Marquee("Stopping job...");501 Content.Progress.Start("Stopping job...", ProgressMode.Indeterminate); 502 502 HiveClient.StopJob((RefreshableJob)job); 503 503 Content.Progress.Finish(); … … 505 505 506 506 private void ResumeJobAsync(object job) { 507 Content.Progress.Start Marquee("Resuming job...");507 Content.Progress.Start("Resuming job...", ProgressMode.Indeterminate); 508 508 HiveClient.ResumeJob((RefreshableJob)job); 509 509 Content.Progress.Finish(); -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Views/3.3/HiveTasks/OptimizerHiveTaskView.cs
r16314 r16317 99 99 100 100 private void PauseTaskAsync() { 101 Content.Progress.Start Marquee("Pausing task. Please be patient for the command to take effect.");101 Content.Progress.Start("Pausing task. Please be patient for the command to take effect.", ProgressMode.Indeterminate); 102 102 Content.Pause(); 103 103 Content.Progress.Finish(); … … 105 105 106 106 private void StopTaskAsync() { 107 Content.Progress.Start Marquee("Stopping task. Please be patient for the command to take effect.");107 Content.Progress.Start("Stopping task. Please be patient for the command to take effect.", ProgressMode.Indeterminate); 108 108 Content.Stop(); 109 109 Content.Progress.Finish(); … … 111 111 112 112 private void ResumeTaskAsync() { 113 Content.Progress.Start Marquee("Resuming task. Please be patient for the command to take effect.");113 Content.Progress.Start("Resuming task. Please be patient for the command to take effect.", ProgressMode.Indeterminate); 114 114 Content.Restart(); 115 115 Content.Progress.Finish(); -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r16312 r16317 469 469 470 470 try { 471 refreshableJob.Progress.Start Marquee("Saving Job...");471 refreshableJob.Progress.Start("Saving Job...", ProgressMode.Indeterminate); 472 472 HiveClient.StoreAsync(new Action<Exception>((Exception ex) => { 473 473 throw new Exception("Update failed.", ex); … … 488 488 try { 489 489 refreshableJob.IsProgressing = true; 490 refreshableJob.Progress.Start Marquee("Connecting to server...");490 refreshableJob.Progress.Start("Connecting to server...", ProgressMode.Indeterminate); 491 491 492 492 foreach (OptimizerHiveTask hiveJob in refreshableJob.HiveTasks.OfType<OptimizerHiveTask>()) { … … 514 514 // upload tasks 515 515 refreshableJob.Progress.Message = "Uploading tasks..."; 516 refreshableJob.Progress.Progress BarMode = ProgressBarMode.Continuous;516 refreshableJob.Progress.ProgressMode = ProgressMode.Determinate; 517 517 refreshableJob.Progress.ProgressValue = 0; 518 518 … … 643 643 644 644 // fetch all task objects to create the full tree of tree of HiveTask objects 645 refreshableJob.Progress.Start Marquee("Downloading list of tasks...");645 refreshableJob.Progress.Start("Downloading list of tasks...", ProgressMode.Indeterminate); 646 646 allTasks = HiveServiceLocator.Instance.CallHiveService(s => s.GetLightweightJobTasksWithoutStateLog(hiveExperiment.Id)); 647 647 totalJobCount = allTasks.Count(); 648 648 649 649 refreshableJob.Progress.Message = "Downloading tasks..."; 650 refreshableJob.Progress.Progress BarMode = ProgressBarMode.Continuous;650 refreshableJob.Progress.ProgressMode = ProgressMode.Determinate; 651 651 refreshableJob.Progress.ProgressValue = 0.0; 652 652 downloader = new TaskDownloader(allTasks.Select(x => x.Id)); … … 666 666 667 667 refreshableJob.Progress.Message = "Downloading/deserializing complete. Displaying tasks..."; 668 refreshableJob.Progress.Progress BarMode = ProgressBarMode.Marquee;668 refreshableJob.Progress.ProgressMode = ProgressMode.Indeterminate; 669 669 670 670 // build child-task tree -
branches/2845_EnhancedProgress/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBExperimentUploadView.cs
r16311 r16317 188 188 if (InvokeRequired) { Invoke((Action<object, EventArgs>)RunCreationClient_Refreshing, sender, e); return; } 189 189 var message = "Refreshing algorithms and problems..."; 190 Progress.Show Marquee(this, message);190 Progress.Show(this, message, ProgressMode.Indeterminate); 191 191 refreshing = true; 192 192 SetEnabledStateOfControls(); -
branches/2845_EnhancedProgress/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r16311 r16317 220 220 if (storable != null) { 221 221 try { 222 Progress.Show Marquee(Content, "Exporting data.");222 Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate); 223 223 ContentManager.Save(storable, saveFileDialog.FileName, compressed); 224 224 } finally { … … 241 241 try { 242 242 var problemData = Content.CreateNewProblemData(); 243 Progress.Show Marquee(Content, "Exporting data.");243 Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate); 244 244 if (problemData is TimeSeriesPrognosisProblemData) 245 245 Export(new TimeSeriesPrognosisCSVInstanceProvider(), problemData, saveFileDialog.FileName); -
branches/2845_EnhancedProgress/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
r16311 r16317 163 163 } 164 164 165 if (content.ProgressBarMode == ProgressBarMode.Continuous) { 166 progressBar.Style = ProgressBarStyle.Continuous; 167 progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum)); 168 } else { 169 progressBar.Style = ProgressBarStyle.Marquee; 170 progressBar.Value = 0; 165 switch (content.ProgressMode) { 166 case ProgressMode.Determinate: 167 progressBar.Style = ProgressBarStyle.Continuous; 168 progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum)); 169 break; 170 case ProgressMode.Indeterminate: 171 progressBar.Style = ProgressBarStyle.Marquee; 172 progressBar.Value = 0; 173 break; 174 default: 175 throw new NotImplementedException($"Invalid Progress Mode: {content.ProgressMode}"); 171 176 } 172 177 } -
branches/2845_EnhancedProgress/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r16314 r16317 381 381 /// Adds a <see cref="ProgressView"/> to the specified view. 382 382 /// </summary> 383 internal void AddProgressTo View(Control control, IProgress progress) {383 internal void AddProgressToControl(Control control, IProgress progress) { 384 384 if (InvokeRequired) { 385 Invoke((Action<Control, IProgress>)AddProgressTo View, control, progress);385 Invoke((Action<Control, IProgress>)AddProgressToControl, control, progress); 386 386 return; 387 387 } … … 426 426 /// Removes an existing <see cref="ProgressView"/> from the specified view. 427 427 /// </summary> 428 internal void RemoveProgressFrom View(Control control, bool finishProgress = true) {428 internal void RemoveProgressFromControl(Control control, bool finishProgress = true) { 429 429 if (InvokeRequired) { 430 Invoke((Action<Control, bool>)RemoveProgressFrom View, control, finishProgress);430 Invoke((Action<Control, bool>)RemoveProgressFromControl, control, finishProgress); 431 431 return; 432 432 } -
branches/2845_EnhancedProgress/HeuristicLab.MainForm.WindowsForms/3.3/Progress.cs
r16314 r16317 48 48 } 49 49 50 private Progress BarMode progressBarMode;51 public Progress BarMode ProgressBarMode {52 get { return progress BarMode; }53 set { 54 if (progress BarMode != value) {55 progress BarMode = value;50 private ProgressMode progressMode; 51 public ProgressMode ProgressMode { 52 get { return progressMode; } 53 set { 54 if (progressMode != value) { 55 progressMode = value; 56 56 OnProgressBarModeChanged(); 57 57 } … … 63 63 get { return progressValue; } 64 64 set { 65 if (progress BarMode == ProgressBarMode.Marquee)66 throw new InvalidOperationException("Cannot set ProgressValue while ProgressBar is in Marquee-Mode");65 if (progressMode == ProgressMode.Indeterminate) 66 throw new InvalidOperationException("Cannot set ProgressValue while ProgressBar is in Indeterminate-Mode"); 67 67 if (progressValue != value) { 68 68 progressValue = Math.Max(Math.Min(value, 1.0), 0.0); … … 98 98 canBeStopped = false; 99 99 canBeCanceled = false; 100 progress BarMode = ProgressBarMode.Marquee;100 progressMode = ProgressMode.Indeterminate; 101 101 progressValue = 0.0; 102 102 } 103 103 104 public void Start(string message, double progressValue = 0) {104 public void Start(string message, ProgressMode mode = ProgressMode.Determinate) { 105 105 ProgressState = ProgressState.Started; 106 ProgressBarMode = ProgressBarMode.Continuous; 107 ProgressValue = progressValue; 106 ProgressMode = mode; 107 if (mode == ProgressMode.Determinate) 108 ProgressValue = 0.0; 108 109 Message = message; 109 110 } 110 public void StartMarquee(string message) {111 ProgressState = ProgressState.Started;112 ProgressBarMode = ProgressBarMode.Marquee;113 Message = message;114 }115 111 116 112 public void Finish() { 117 if (Progress BarMode == ProgressBarMode.Continuous&& ProgressValue != 1.0)113 if (ProgressMode == ProgressMode.Determinate && ProgressValue != 1.0) 118 114 ProgressValue = 1.0; 119 115 ProgressState = ProgressState.Finished; … … 135 131 #region Show/Hide Progress 136 132 /// <summary> 137 /// Shows a started Progress in Continuous-modeon all Views of the specified content.138 /// </summary> 139 public static IProgress Show(IContent content, string progressMessage, double initialProgressValue = 0, bool addToObjectGraphObjects = true) {133 /// Shows a started Progress on all Views of the specified content. 134 /// </summary> 135 public static IProgress Show(IContent content, string progressMessage, ProgressMode mode = ProgressMode.Determinate, bool addToObjectGraphObjects = true) { 140 136 var progress = new Progress(); 141 progress.Start(progressMessage, initialProgressValue);137 progress.Start(progressMessage, mode); 142 138 AddProgressToContent(content, progress, addToObjectGraphObjects); 143 139 return progress; 144 140 } 145 /// <summary> 146 /// Shows a started Progress in Marquee-mode on all Views of the specified content. 147 /// </summary> 148 public static IProgress ShowMarquee(IContent content, string progressMessage, bool addToObjectGraphObjects = true) { 141 142 /// <summary> 143 /// Shows a started Progress on the specified view. 144 /// </summary> 145 public static IProgress Show(IView view, string progressMessage, ProgressMode mode = ProgressMode.Determinate) { 149 146 var progress = new Progress(); 150 progress.Start Marquee(progressMessage);151 AddProgressTo Content(content, progress, addToObjectGraphObjects);152 return progress; 153 } 154 155 /// <summary>156 /// Shows a started Progress in Continuous-mode on the specified view.157 /// < /summary>158 public static IProgress Show (Control control, string progressMessage, double initialProgressValue = 0) {147 progress.Start(progressMessage, mode); 148 AddProgressToView(view, progress); 149 return progress; 150 } 151 /// <summary> 152 /// Shows a started Progress on the specified control. 153 /// </summary> 154 /// <remarks>Use Progress.Show(IView, ...) if possible.</remarks> 155 public static IProgress ShowOnControl(Control control, string progressMessage, ProgressMode mode = ProgressMode.Determinate) { 159 156 var progress = new Progress(); 160 progress.Start(progressMessage, initialProgressValue); 161 AddProgressToView(control, progress); 162 return progress; 163 } 164 /// <summary> 165 /// Shows a started Progress in Marquee-mode on the specified view. 166 /// </summary> 167 public static IProgress ShowMarquee(Control control, string progressMessage) { 168 var progress = new Progress(); 169 progress.StartMarquee(progressMessage); 170 AddProgressToView(control, progress); 157 progress.Start(progressMessage, mode); 158 AddProgressToControl(control, progress); 171 159 return progress; 172 160 } … … 181 169 /// Hides the Progress from the specified view. 182 170 /// </summary> 183 public static void Hide(Control control) { 184 RemoveProgressFromView(control); 171 public static void Hide(IView view) { 172 RemoveProgressFromView(view); 173 } 174 /// <summary> 175 /// Hides the Progress from the specified control. 176 /// </summary> 177 /// <remarks>Use Progress.Hide(IView) if possible.</remarks> 178 public static void HideFromControl(Control control) { 179 RemoveProgressFromControl(control); 185 180 } 186 181 #endregion 187 182 188 #region Interface to fromMainForm183 #region Interface to MainForm 189 184 public static IProgress AddProgressToContent(IContent content, IProgress progress, bool addToObjectGraphObjects = true) { 190 185 MainFormManager.GetMainForm<WindowsForms.MainForm>().AddProgressToContent(content, progress, addToObjectGraphObjects); 191 186 return progress; 192 187 } 193 public static IProgress AddProgressToView(Control control, IProgress progress) { 194 MainFormManager.GetMainForm<WindowsForms.MainForm>().AddProgressToView(control, progress); 188 public static IProgress AddProgressToView(IView view, IProgress progress) { 189 //return AddProgressToControl(MainFormManager.GetMainForm<WindowsForms.MainForm>().GetForm(view), progress); 190 return AddProgressToControl((Control)view, progress); 191 } 192 public static IProgress AddProgressToControl(Control control, IProgress progress) { 193 MainFormManager.GetMainForm<WindowsForms.MainForm>().AddProgressToControl(control, progress); 195 194 return progress; 196 195 } … … 199 198 MainFormManager.GetMainForm<WindowsForms.MainForm>().RemoveProgressFromContent(content, finishProgress); 200 199 } 201 public static void RemoveProgressFromView(Control control, bool finishProgress = true) { 202 MainFormManager.GetMainForm<WindowsForms.MainForm>().RemoveProgressFromView(control, finishProgress); 200 public static void RemoveProgressFromView(IView view, bool finishProgress = true) { 201 //RemoveProgressFromControl(MainFormManager.GetMainForm<WindowsForms.MainForm>().GetForm(view), finishProgress); 202 RemoveProgressFromControl((Control)view, finishProgress); 203 } 204 public static void RemoveProgressFromControl(Control control, bool finishProgress = true) { 205 MainFormManager.GetMainForm<WindowsForms.MainForm>().RemoveProgressFromControl(control, finishProgress); 203 206 } 204 207 #endregion -
branches/2845_EnhancedProgress/HeuristicLab.MainForm/3.3/Interfaces/IProgress.cs
r16311 r16317 25 25 namespace HeuristicLab.MainForm { 26 26 public enum ProgressState { Started, Finished, StopRequested, CancelRequested } 27 public enum Progress BarMode { Continuous, Marquee }27 public enum ProgressMode { Determinate, Indeterminate } 28 28 29 29 public interface IProgress : IContent { 30 30 ProgressState ProgressState { get; } 31 31 32 string Message { get; set; } 32 ProgressBarMode ProgressBarMode { get; set; } 33 34 ProgressMode ProgressMode { get; set; } 33 35 /// <summary> 34 36 /// Gets or sets the currently associated progress value in the range [0;1] (values outside the range are truncated). 35 /// Changing the ProgressValue when ProgressBarMode is Marqueeraises an Exception.37 /// Changing the ProgressValue when <c>ProgressMode</c> is <c>Indeterminate</c> raises an Exception. 36 38 /// </summary> 37 /// <exception cref="InvalidOperationException">Setting the ProgressValue-property while in the Marquee state is invalid.</exception>39 /// <exception cref="InvalidOperationException">Setting the ProgressValue-property while in the Indeterminate state is invalid.</exception> 38 40 double ProgressValue { get; set; } 39 bool CanBeStopped { get; }40 bool CanBeCanceled { get; }41 41 42 /// <summary> 43 /// Start (or Restart) a progress in ProgressBarMode Continues to display specific progress values (from 0 to 1). 44 /// A new progress value is reported by setting the ProgressValue-property. 45 /// </summary> 46 void Start(string message, double progressValue = 0); 42 bool CanBeStopped { get; set; } 43 bool CanBeCanceled { get; set; } 47 44 48 /// <summary> 49 /// Start (or Restart) a progress in ProgressBarMode Marquee to define an "unknown" progress state. 50 /// Consider using marquee when the progress is not measurable but the user should be notified that something is still happening. 51 /// Setting the ProgressValue-property in the Marquee state throws an exception. 52 /// </summary> 53 void StartMarquee(string message); 54 45 void Start(string message, ProgressMode mode = ProgressMode.Determinate); 55 46 void Finish(); 56 47 void Stop(); -
branches/2845_EnhancedProgress/HeuristicLab.Optimizer/3.3/StartPage.cs
r16311 r16317 88 88 89 89 private void LoadSamples(object state) { 90 progress = Progress.Show (samplesListView, "Loading...");90 progress = Progress.ShowOnControl(samplesListView, "Loading..."); 91 91 try { 92 92 var assembly = Assembly.GetExecutingAssembly(); … … 112 112 OnAllSamplesLoaded(); 113 113 } finally { 114 Progress.Hide (samplesListView);114 Progress.HideFromControl(samplesListView); 115 115 } 116 116 } -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationSolutionView.cs
r16311 r16317 60 60 var name = exportFileDialog.FileName; 61 61 using (BackgroundWorker bg = new BackgroundWorker()) { 62 Progress.Show Marquee(this, "Exportion solution to " + name + ".");62 Progress.Show(this, "Exportion solution to " + name + ".", ProgressMode.Indeterminate); 63 63 bg.DoWork += (o, a) => exporter.Export(Content, name); 64 64 bg.RunWorkerCompleted += (o, a) => Progress.Hide(this); -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs
r16311 r16317 59 59 var name = exportFileDialog.FileName; 60 60 using (BackgroundWorker bg = new BackgroundWorker()) { 61 Progress.Show Marquee(this, "Exportion solution to " + name + ".");61 Progress.Show(this, "Exportion solution to " + name + ".", ProgressMode.Indeterminate); 62 62 bg.DoWork += (o, a) => exporter.Export(Content, name); 63 63 bg.RunWorkerCompleted += (o, a) => Progress.Hide(this); -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs
r16311 r16317 61 61 var name = exportFileDialog.FileName; 62 62 using (BackgroundWorker bg = new BackgroundWorker()) { 63 Progress.Show Marquee(this, "Exporting solution to " + name + ".");63 Progress.Show(this, "Exporting solution to " + name + ".", ProgressMode.Indeterminate); 64 64 bg.DoWork += (o, a) => exporter.Export(Content, name); 65 65 bg.RunWorkerCompleted += (o, a) => Progress.Hide(this); -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r16314 r16317 154 154 Content.ProblemDataChanged += Content_Changed; 155 155 treeChart.Repainted += treeChart_Repainted; 156 Progress.AddProgressTo View(grpSimplify, progress);156 Progress.AddProgressToControl(grpSimplify, progress); 157 157 progress.StopRequested += progress_StopRequested; 158 158 } … … 162 162 Content.ProblemDataChanged -= Content_Changed; 163 163 treeChart.Repainted -= treeChart_Repainted; 164 Progress.RemoveProgressFrom View(grpSimplify, false);164 Progress.RemoveProgressFromControl(grpSimplify, false); 165 165 progress.StopRequested -= progress_StopRequested; 166 166 } -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs
r16311 r16317 158 158 variableImactsArrayView.Caption = Content.Name + " Variable Impacts"; 159 159 160 Progress.Show Marquee(this, "Calculating variable impacts for " + Content.Name);160 Progress.Show(this, "Calculating variable impacts for " + Content.Name, ProgressMode.Indeterminate); 161 161 162 162 Task.Factory.StartNew(() => { -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/ShrinkDataAnalysisRunsMenuItem.cs
r16311 r16317 73 73 IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView; 74 74 var content = activeView.Content; 75 Progress.Show Marquee(content, "Removing duplicate datasets.");75 Progress.Show(content, "Removing duplicate datasets.", ProgressMode.Indeterminate); 76 76 77 77 Action<IContentView> action = (view) => DatasetUtil.RemoveDuplicateDatasets(view.Content); -
branches/2845_EnhancedProgress/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.cs
r16311 r16317 123 123 var content = activeView.Content; 124 124 // lock active view and show progress bar 125 Progress.Show Marquee(content, "Loading problem instance.");125 Progress.Show(content, "Loading problem instance.", ProgressMode.Indeterminate); 126 126 127 127 Task.Factory.StartNew(() => { -
branches/2845_EnhancedProgress/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
r16311 r16317 178 178 179 179 private void AddProgressView(string progressMessage) { 180 Progress.Show Marquee(this, progressMessage);180 Progress.Show(this, progressMessage, ProgressMode.Indeterminate); 181 181 progressViewCreated = true; 182 182 }
Note: See TracChangeset
for help on using the changeset viewer.