- Timestamp:
- 03/28/19 16:54:20 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 42 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/ActionUserInterfaceItem.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ControlExtensions.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 46 46 } 47 47 } 48 49 public static IEnumerable<Control> GetNestedControls(this Control control, Func<Control, bool> condition = null) {50 if (control == null) yield break;51 if (condition == null) condition = (c) => true;52 53 Queue<Control> unprocessed = new Queue<Control>();54 unprocessed.Enqueue(control);55 56 while (unprocessed.Count > 0) {57 Control c = unprocessed.Dequeue();58 if (condition(c)) yield return c;59 foreach (Control child in c.Controls)60 unprocessed.Enqueue(child);61 }62 }63 48 } 64 49 } -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/DragOverTabControl.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/DragOverTabControl.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 namespace HeuristicLab.MainForm.WindowsForms { 26 26 internal sealed partial class ProgressView : UserControl { 27 private const int defaultControlHeight = 88;28 private const int collapsedControlHeight = 55;29 30 27 private readonly Control control; 31 28 public Control Control { … … 40 37 public ProgressView(Control control, IProgress content) 41 38 : base() { 42 if (control == null) throw new ArgumentNullException("control", "The control is null."); 43 if (content == null) throw new ArgumentNullException("content", "The passed progress is null."); 39 if (control == null) throw new ArgumentNullException("control"); 40 if (control.Parent == null) throw new InvalidOperationException("A Progress can only be shown on controls that have a Parent-control. Therefore, Dialogs and Forms cannot have an associated ProgressView."); 41 if (content == null) throw new ArgumentNullException("content"); 44 42 InitializeComponent(); 45 43 46 44 this.control = control; 47 45 this.content = content; 48 if (content.ProgressState == ProgressState.Started) 46 47 if (content.ProgressState != ProgressState.Finished) 49 48 ShowProgress(); 50 49 RegisterContentEvents(); 51 50 } 52 51 53 /// <summary>54 /// Clean up any resources being used.55 /// </summary>56 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>57 52 protected override void Dispose(bool disposing) { 58 53 DeregisterContentEvents(); … … 66 61 67 62 private void RegisterContentEvents() { 68 content.StatusChanged += new EventHandler(progress_StatusChanged); 69 content.ProgressValueChanged += new EventHandler(progress_ProgressValueChanged); 70 content.ProgressStateChanged += new EventHandler(Content_ProgressStateChanged); 71 content.CanBeCanceledChanged += new EventHandler(Content_CanBeCanceledChanged); 63 Content.ProgressStateChanged += new EventHandler(Content_ProgressStateChanged); 64 Content.MessageChanged += new EventHandler(Content_MessageChanged); 65 Content.ProgressBarModeChanged += new EventHandler(Content_ProgressBarModeChanged); 66 Content.ProgressValueChanged += new EventHandler(Content_ProgressValueChanged); 67 Content.CanBeStoppedChanged += new EventHandler(Content_CanBeStoppedChanged); 68 Content.CanBeCanceledChanged += new EventHandler(Content_CanBeCanceledChanged); 72 69 } 73 70 private void DeregisterContentEvents() { 74 content.StatusChanged -= new EventHandler(progress_StatusChanged); 75 content.ProgressValueChanged -= new EventHandler(progress_ProgressValueChanged); 76 content.ProgressStateChanged -= new EventHandler(Content_ProgressStateChanged); 77 content.CanBeCanceledChanged -= new EventHandler(Content_CanBeCanceledChanged); 71 Content.ProgressStateChanged -= new EventHandler(Content_ProgressStateChanged); 72 Content.MessageChanged -= new EventHandler(Content_MessageChanged); 73 Content.ProgressBarModeChanged -= new EventHandler(Content_ProgressBarModeChanged); 74 Content.ProgressValueChanged -= new EventHandler(Content_ProgressValueChanged); 75 Content.CanBeStoppedChanged -= new EventHandler(Content_CanBeStoppedChanged); 76 Content.CanBeCanceledChanged -= new EventHandler(Content_CanBeCanceledChanged); 77 } 78 79 private void Content_ProgressStateChanged(object sender, EventArgs e) { 80 UpdateProgressState(); 81 UpdateButtonsState(); 82 } 83 84 private void Content_MessageChanged(object sender, EventArgs e) { 85 UpdateProgressMessage(); 86 } 87 88 private void Content_ProgressBarModeChanged(object sender, EventArgs e) { 89 UpdateProgressValue(); 90 } 91 private void Content_ProgressValueChanged(object sender, EventArgs e) { 92 UpdateProgressValue(); 93 } 94 95 private void Content_CanBeStoppedChanged(object sender, EventArgs e) { 96 UpdateButtonsState(); 97 } 98 private void Content_CanBeCanceledChanged(object sender, EventArgs e) { 99 UpdateButtonsState(); 78 100 } 79 101 … … 83 105 return; 84 106 } 85 i nt height = Content.CanBeCanceled ? Height : collapsedControlHeight;107 if (Parent != null) return; 86 108 87 109 Left = (Control.ClientRectangle.Width / 2) - (Width / 2); 88 Top = (Control.ClientRectangle.Height / 2) - ( height / 2);110 Top = (Control.ClientRectangle.Height / 2) - (Height / 2); 89 111 Anchor = AnchorStyles.None; 90 112 91 control.Enabled = false; 113 UpdateProgressMessage(); 114 UpdateProgressValue(); 115 UpdateButtonsState(); 116 117 Control.SuspendRepaint(); 118 Control.Enabled = false; 92 119 Parent = Control.Parent; 93 120 BringToFront(); 94 95 UpdateProgressValue(); 96 UpdateProgressStatus(); 97 UpdateCancelButton(); 121 Control.ResumeRepaint(true); 98 122 Visible = true; 99 123 } 100 124 101 125 private void HideProgress() { 102 if (InvokeRequired) Invoke((Action)HideProgress); 103 else { 104 control.Enabled = true; 105 Parent = null; 106 Visible = false; 107 } 108 } 109 110 private void progress_StatusChanged(object sender, EventArgs e) { 111 UpdateProgressStatus(); 112 } 113 114 private void progress_ProgressValueChanged(object sender, EventArgs e) { 115 UpdateProgressValue(); 116 } 117 118 private void Content_ProgressStateChanged(object sender, EventArgs e) { 119 switch (content.ProgressState) { 120 case ProgressState.Finished: HideProgress(); break; 121 case ProgressState.Canceled: HideProgress(); break; 122 case ProgressState.Started: ShowProgress(); break; 123 default: throw new NotSupportedException("The progress state " + content.ProgressState + " is not supported by the ProgressView."); 124 } 125 } 126 127 private void Content_CanBeCanceledChanged(object sender, EventArgs e) { 128 UpdateCancelButton(); 129 } 130 131 private void UpdateCancelButton() { 132 cancelButton.Visible = content != null && content.CanBeCanceled; 133 cancelButton.Enabled = content != null && content.CanBeCanceled; 134 135 if (content != null && content.CanBeCanceled) { 136 Height = defaultControlHeight; 137 } else if (content != null && !content.CanBeCanceled) { 138 Height = collapsedControlHeight; 139 } 126 if (Control.InvokeRequired) { 127 Control.Invoke((Action)HideProgress); 128 return; 129 } 130 if (Parent == null) return; 131 132 Visible = false; 133 Control.SuspendRepaint(); 134 Control.Enabled = true; 135 Control.ResumeRepaint(true); 136 Parent = null; 137 } 138 139 private void UpdateProgressState() { 140 if (Control.InvokeRequired) { 141 Control.Invoke((Action)UpdateProgressState); 142 return; 143 } 144 145 if (Content.ProgressState != ProgressState.Finished) 146 ShowProgress(); 147 else 148 HideProgress(); 149 } 150 151 private void UpdateProgressMessage() { 152 if (Control.InvokeRequired) { 153 Control.Invoke((Action)UpdateProgressMessage); 154 return; 155 } 156 157 messageLabel.Text = content.Message; 140 158 } 141 159 142 160 private void UpdateProgressValue() { 143 // prevent problems with object disposal and invoke as suggested by http://stackoverflow.com/a/18647091144 if (!IsHandleCreated) return;145 161 if (InvokeRequired) { 146 try { 147 Invoke((Action)UpdateProgressValue); 148 } 149 catch (InvalidOperationException) { 150 // swallow ObjectDisposedException 151 // which might occur if the invoke call is executed after or while the control is disposing 152 } 153 } else { 154 if (content != null) { 155 double progressValue = content.ProgressValue; 156 if (progressValue <= 0.0 || progressValue > 1.0) { 157 progressBar.Style = ProgressBarStyle.Marquee; 158 } else { 159 progressBar.Style = ProgressBarStyle.Blocks; 160 progressBar.Value = 161 (int)Math.Round(progressBar.Minimum + progressValue * (progressBar.Maximum - progressBar.Minimum)); 162 } 163 } 164 } 165 } 166 167 private void UpdateProgressStatus() { 168 if (InvokeRequired) Invoke((Action)UpdateProgressStatus); 169 else if (content != null) 170 statusLabel.Text = content.Status; 171 } 172 162 Invoke((Action)UpdateProgressValue); 163 return; 164 } 165 166 switch (Content.ProgressMode) { 167 case ProgressMode.Determinate: 168 progressBar.Style = ProgressBarStyle.Continuous; 169 progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum)); 170 break; 171 case ProgressMode.Indeterminate: 172 progressBar.Style = ProgressBarStyle.Marquee; 173 progressBar.Value = 0; 174 break; 175 default: 176 throw new NotImplementedException($"Invalid Progress Mode: {content.ProgressMode}"); 177 } 178 } 179 180 private void UpdateButtonsState() { 181 if (Control.InvokeRequired) { 182 Control.Invoke((Action)UpdateButtonsState); 183 return; 184 } 185 186 stopButton.Visible = Content.CanBeStopped; 187 stopButton.Enabled = Content.CanBeStopped && content.ProgressState == ProgressState.Started; 188 189 cancelButton.Visible = Content.CanBeCanceled; 190 cancelButton.Enabled = Content.CanBeCanceled && content.ProgressState == ProgressState.Started; 191 } 192 193 private void stopButton_Click(object sender, EventArgs e) { 194 Content.Stop(); 195 } 173 196 private void cancelButton_Click(object sender, EventArgs e) { 174 content.Cancel();197 Content.Cancel(); 175 198 } 176 199 } -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 private System.ComponentModel.IContainer components = null; 28 28 29 29 30 30 #region Component Designer generated code 31 31 … … 36 36 private void InitializeComponent() { 37 37 this.progressBar = new System.Windows.Forms.ProgressBar(); 38 this.statusLabel = new System.Windows.Forms.Label(); 38 this.messageLabel = new System.Windows.Forms.Label(); 39 this.borderPanel = new System.Windows.Forms.Panel(); 40 this.panel = new System.Windows.Forms.Panel(); 41 this.stopButton = new System.Windows.Forms.Button(); 39 42 this.cancelButton = new System.Windows.Forms.Button(); 40 this. panel = new System.Windows.Forms.Panel();43 this.borderPanel.SuspendLayout(); 41 44 this.panel.SuspendLayout(); 42 45 this.SuspendLayout(); … … 48 51 this.progressBar.Location = new System.Drawing.Point(3, 3); 49 52 this.progressBar.Name = "progressBar"; 50 this.progressBar.Size = new System.Drawing.Size(3 52, 23);53 this.progressBar.Size = new System.Drawing.Size(366, 23); 51 54 this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Marquee; 52 55 this.progressBar.TabIndex = 0; 53 56 // 54 // statusLabel57 // messageLabel 55 58 // 56 this.statusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 59 this.messageLabel.Dock = System.Windows.Forms.DockStyle.Fill; 60 this.messageLabel.Location = new System.Drawing.Point(0, 0); 61 this.messageLabel.Name = "messageLabel"; 62 this.messageLabel.Padding = new System.Windows.Forms.Padding(0, 0, 3, 0); 63 this.messageLabel.Size = new System.Drawing.Size(217, 23); 64 this.messageLabel.TabIndex = 1; 65 this.messageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 66 // 67 // borderPanel 68 // 69 this.borderPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 70 | System.Windows.Forms.AnchorStyles.Left) 57 71 | System.Windows.Forms.AnchorStyles.Right))); 58 this.statusLabel.Location = new System.Drawing.Point(3, 33); 59 this.statusLabel.Name = "statusLabel"; 60 this.statusLabel.Size = new System.Drawing.Size(352, 17); 61 this.statusLabel.TabIndex = 1; 72 this.borderPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 73 this.borderPanel.Controls.Add(this.panel); 74 this.borderPanel.Controls.Add(this.progressBar); 75 this.borderPanel.Location = new System.Drawing.Point(0, 0); 76 this.borderPanel.Name = "borderPanel"; 77 this.borderPanel.Size = new System.Drawing.Size(374, 62); 78 this.borderPanel.TabIndex = 3; 79 // 80 // panel 81 // 82 this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 83 | System.Windows.Forms.AnchorStyles.Right))); 84 this.panel.Controls.Add(this.messageLabel); 85 this.panel.Controls.Add(this.stopButton); 86 this.panel.Controls.Add(this.cancelButton); 87 this.panel.Location = new System.Drawing.Point(3, 32); 88 this.panel.Name = "panel"; 89 this.panel.Size = new System.Drawing.Size(367, 23); 90 this.panel.TabIndex = 4; 91 // 92 // stopButton 93 // 94 this.stopButton.Dock = System.Windows.Forms.DockStyle.Right; 95 this.stopButton.Location = new System.Drawing.Point(217, 0); 96 this.stopButton.Name = "stopButton"; 97 this.stopButton.Size = new System.Drawing.Size(75, 23); 98 this.stopButton.TabIndex = 3; 99 this.stopButton.Text = "Stop"; 100 this.stopButton.UseVisualStyleBackColor = true; 101 this.stopButton.Click += new System.EventHandler(this.stopButton_Click); 62 102 // 63 103 // cancelButton 64 104 // 65 this.cancelButton. Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));66 this.cancelButton.Location = new System.Drawing.Point(2 80, 53);105 this.cancelButton.Dock = System.Windows.Forms.DockStyle.Right; 106 this.cancelButton.Location = new System.Drawing.Point(292, 0); 67 107 this.cancelButton.Name = "cancelButton"; 68 108 this.cancelButton.Size = new System.Drawing.Size(75, 23); … … 72 112 this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); 73 113 // 74 // panel75 //76 this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)77 | System.Windows.Forms.AnchorStyles.Left)78 | System.Windows.Forms.AnchorStyles.Right)));79 this.panel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;80 this.panel.Controls.Add(this.progressBar);81 this.panel.Controls.Add(this.cancelButton);82 this.panel.Controls.Add(this.statusLabel);83 this.panel.Location = new System.Drawing.Point(0, 0);84 this.panel.Name = "panel";85 this.panel.Size = new System.Drawing.Size(360, 88);86 this.panel.TabIndex = 3;87 //88 114 // ProgressView 89 115 // 90 116 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 91 this.Controls.Add(this. panel);117 this.Controls.Add(this.borderPanel); 92 118 this.Name = "ProgressView"; 93 this.Size = new System.Drawing.Size(360, 88); 119 this.Size = new System.Drawing.Size(374, 62); 120 this.borderPanel.ResumeLayout(false); 94 121 this.panel.ResumeLayout(false); 95 122 this.ResumeLayout(false); … … 100 127 101 128 private System.Windows.Forms.ProgressBar progressBar; 102 private System.Windows.Forms.Label statusLabel; 129 private System.Windows.Forms.Label messageLabel; 130 private System.Windows.Forms.Panel borderPanel; 131 private System.Windows.Forms.Button stopButton; 132 private System.Windows.Forms.Panel panel; 103 133 private System.Windows.Forms.Button cancelButton; 104 private System.Windows.Forms.Panel panel;105 134 } 106 135 } -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/Sidebar.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/Sidebar.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewContextMenuStrip.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewContextMenuStrip.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ViewHost.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/DefineArithmeticProgressionDialog.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/DefineArithmeticProgressionDialog.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/DefineArithmeticProgressionTimeDialog.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/DefineArithmeticProgressionTimeDialog.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using System.ComponentModel; 25 using System.Globalization;26 25 using System.Linq; 27 26 using System.Windows.Forms; -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/InfoBox.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/InfoBox.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLab.MainForm.WindowsForms-3.3.csproj
r11623 r16723 11 11 <RootNamespace>HeuristicLab.MainForm.WindowsForms</RootNamespace> 12 12 <AssemblyName>HeuristicLab.MainForm.WindowsForms-3.3</AssemblyName> 13 <TargetFrameworkVersion>v4. 5</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 14 14 <TargetFrameworkProfile> 15 15 </TargetFrameworkProfile> … … 151 151 </Compile> 152 152 <Compile Include="Plugin.cs" /> 153 <Compile Include="Progress.cs" /> 153 154 <Compile Include="Views\AsynchronousContentView.cs"> 154 155 <SubType>UserControl</SubType> -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DockForm.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DockForm.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DockingMainForm.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DockingMainForm.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DocumentForm.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DocumentForm.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 61 61 set { 62 62 if (InvokeRequired) { 63 Action<string> action = delegate (string s) { this.Title = s; };63 Action<string> action = delegate (string s) { this.Title = s; }; 64 64 Invoke(action, value); 65 65 } else … … 72 72 set { 73 73 if (InvokeRequired) { 74 Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; };74 Action<Cursor> action = delegate (Cursor c) { this.Cursor = c; }; 75 75 Invoke(action, value); 76 76 } else … … 95 95 if (this.activeView != value) { 96 96 if (InvokeRequired) { 97 Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; };97 Action<IView> action = delegate (IView activeView) { this.ActiveView = activeView; }; 98 98 Invoke(action, value); 99 99 } else { … … 230 230 } 231 231 232 public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent {232 public IContentView ShowContent<T>(T content, bool reuseExistingView, IEqualityComparer<T> comparer = null) where T : class, IContent { 233 233 if (content == null) throw new ArgumentNullException("Content cannot be null."); 234 234 if (!reuseExistingView) return ShowContent(content); … … 353 353 /// Adds a <see cref="ProgressView"/> to the <see cref="ContentView"/>s showing the specified content. 354 354 /// </summary> 355 public IProgress AddOperationProgressToContent(IContent content, string progressMessage, bool addToObjectGraphObjects = true) {355 internal void AddProgressToContent(IContent content, IProgress progress, bool addToObjectGraphObjects) { 356 356 if (InvokeRequired) { 357 I Progress result = (IProgress)Invoke((Func<IContent, string, bool, IProgress>)AddOperationProgressToContent, content, progressMessage, addToObjectGraphObjects);358 return result;357 Invoke((Action<IContent, IProgress, bool>)AddProgressToContent, content, progress, addToObjectGraphObjects); 358 return; 359 359 } 360 360 if (contentProgressLookup.ContainsKey(content)) … … 371 371 contentViews = contentViews.Where(v => v.Content == content); 372 372 373 var progress = new Progress(progressMessage, ProgressState.Started);374 373 foreach (var contentView in contentViews) { 375 374 progressViews.Add(new ProgressView(contentView, progress)); … … 377 376 378 377 contentProgressLookup[content] = progress; 379 return progress;380 378 } 381 379 … … 383 381 /// Adds a <see cref="ProgressView"/> to the specified view. 384 382 /// </summary> 385 public IProgress AddOperationProgressToView(Control control, string progressMessage) { 386 var progress = new Progress(progressMessage, ProgressState.Started); 387 AddOperationProgressToView(control, progress); 388 return progress; 389 } 390 391 public void AddOperationProgressToView(Control control, IProgress progress) { 383 internal void AddProgressToControl(Control control, IProgress progress) { 392 384 if (InvokeRequired) { 393 Invoke((Action<Control, IProgress>)Add OperationProgressToView, control, progress);385 Invoke((Action<Control, IProgress>)AddProgressToControl, control, progress); 394 386 return; 395 387 } … … 413 405 /// Removes an existing <see cref="ProgressView"/> from the <see cref="ContentView"/>s showing the specified content. 414 406 /// </summary> 415 public void RemoveOperationProgressFromContent(IContent content, bool finishProgress = true) {407 internal void RemoveProgressFromContent(IContent content, bool finishProgress) { 416 408 if (InvokeRequired) { 417 Invoke((Action<IContent, bool>)Remove OperationProgressFromContent, content, finishProgress);409 Invoke((Action<IContent, bool>)RemoveProgressFromContent, content, finishProgress); 418 410 return; 419 411 } … … 429 421 } 430 422 contentProgressLookup.Remove(content); 431 432 423 } 433 424 … … 435 426 /// Removes an existing <see cref="ProgressView"/> from the specified view. 436 427 /// </summary> 437 public void RemoveOperationProgressFromView(Control control, bool finishProgress = true) {428 internal void RemoveProgressFromControl(Control control, bool finishProgress) { 438 429 if (InvokeRequired) { 439 Invoke((Action<Control, bool>)Remove OperationProgressFromView, control, finishProgress);430 Invoke((Action<Control, bool>)RemoveProgressFromControl, control, finishProgress); 440 431 return; 441 432 } … … 560 551 try { 561 552 ((IActionUserInterfaceItem)item.Tag).Execute(); 562 } 563 catch (Exception ex) { 553 } catch (Exception ex) { 564 554 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex); 565 555 } -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MultipleDocumentMainForm.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MultipleDocumentMainForm.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/SingleDocumentMainForm.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/SingleDocumentMainForm.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/MenuItem.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Plugin.cs.frame
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Properties/AssemblyInfo.cs.frame
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/ToolBarItem.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Views/AsynchronousContentView.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Views/AsynchronousContentView.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Views/ContentView.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Views/ContentView.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Views/View.Designer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.MainForm.WindowsForms/3.3/Views/View.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.