Changeset 3632
- Timestamp:
- 05/05/10 14:04:53 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.Designer.cs
r3346 r3632 165 165 #endregion 166 166 167 pr ivateSystem.Windows.Forms.Label rowsLabel;168 pr ivateSystem.Windows.Forms.TextBox rowsTextBox;169 pr ivateSystem.Windows.Forms.ErrorProvider errorProvider;170 pr ivateSystem.Windows.Forms.TextBox columnsTextBox;171 pr ivateSystem.Windows.Forms.Label columnsLabel;172 pr ivateSystem.Windows.Forms.ContextMenuStrip contextMenu;173 pr ivateSystem.Windows.Forms.ToolStripMenuItem ShowHideColumns;167 protected System.Windows.Forms.Label rowsLabel; 168 protected System.Windows.Forms.TextBox rowsTextBox; 169 protected System.Windows.Forms.ErrorProvider errorProvider; 170 protected System.Windows.Forms.TextBox columnsTextBox; 171 protected System.Windows.Forms.Label columnsLabel; 172 protected System.Windows.Forms.ContextMenuStrip contextMenu; 173 protected System.Windows.Forms.ToolStripMenuItem ShowHideColumns; 174 174 protected System.Windows.Forms.DataGridView dataGridView; 175 175 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.Designer.cs
r3614 r3632 34 34 this.txtConstraintData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 35 35 | System.Windows.Forms.AnchorStyles.Right))); 36 this.errorProvider.SetIconAlignment(this.txtConstraintData, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 37 this.errorProvider.SetIconPadding(this.txtConstraintData, 2); 36 38 this.txtConstraintData.Location = new System.Drawing.Point(127, 56); 37 39 this.txtConstraintData.Name = "txtConstraintData"; 38 40 this.txtConstraintData.Size = new System.Drawing.Size(246, 20); 39 41 this.txtConstraintData.TabIndex = 9; 40 this.txtConstraintData. TextChanged += new System.EventHandler(this.txtConstraintData_TextChanged);42 this.txtConstraintData.Validated += new System.EventHandler(this.txtConstraintData_Validated); 41 43 this.txtConstraintData.Validating += new System.ComponentModel.CancelEventHandler(this.txtConstraintData_Validating); 42 44 // -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectioComparisonConstraintView.cs
r3614 r3632 36 36 37 37 protected override void DeregisterContentEvents() { 38 base. RegisterContentEvents();38 base.DeregisterContentEvents(); 39 39 Content.ConstraintDataChanged -= new EventHandler(Content_ConstraintDataChanged); 40 40 } … … 52 52 } 53 53 } 54 if (Content.ConstraintColumn >= 0) 54 if (Content.ConstraintColumn >= 0) { 55 55 this.cmbConstraintColumn.SelectedItem = (matrix.ColumnNames.ElementAt(Content.ConstraintColumn)); 56 if (Content.ConstraintData != null) 57 txtConstraintData.Text = Content.ConstraintData.GetValue(); 58 else 59 this.Content_ConstraintColumnChanged(cmbConstraintColumn, EventArgs.Empty); 60 } 56 61 } 57 62 } … … 74 79 } 75 80 76 private void txtConstraintData_TextChanged(object sender, EventArgs e) { 77 Content.ConstraintData.SetValue(txtConstraintData.Text); 81 private void txtConstraintData_Validated(object sender, EventArgs e) { 82 IStringConvertibleValue value = (IStringConvertibleValue)Activator.CreateInstance(Content.ConstrainedValue.GetDataType(cmbConstraintColumn.SelectedItem.ToString()).First()); 83 value.SetValue(txtConstraintData.Text); 84 Content.ConstraintData = value; 78 85 } 79 86 80 87 private void txtConstraintData_Validating(object sender, CancelEventArgs e) { 81 string errorMessage ;88 string errorMessage = string.Empty; 82 89 if (!Content.ConstraintData.Validate(txtConstraintData.Text, out errorMessage)) { 83 90 errorProvider.SetError(txtConstraintData, errorMessage); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r3614 r3632 120 120 } 121 121 private void run_Changed(object sender, EventArgs e) { 122 IRun run = (IRun)sender; 123 UpdateRun(run); 122 if (InvokeRequired) 123 this.Invoke(new EventHandler(run_Changed), sender, e); 124 else { 125 IRun run = (IRun)sender; 126 UpdateRun(run); 127 } 124 128 } 125 129 … … 144 148 UpdateComboBoxes(); 145 149 UpdateDataPoints(); 146 foreach (IRun run in Content)150 foreach (IRun run in Content) 147 151 UpdateRun(run); 148 152 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.Designer.cs
r3614 r3632 12 12 protected override void Dispose(bool disposing) { 13 13 if (disposing) { 14 if (createParameterDialog != null) createParameterDialog.Dispose();15 14 if (components != null) components.Dispose(); 16 15 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionConstraintCollectionView.cs
r3614 r3632 32 32 [Content(typeof(IItemCollection<IRunCollectionConstraint>), false)] 33 33 public partial class RunCollectionConstraintCollectionView : ItemCollectionView<IRunCollectionConstraint> { 34 protected CreateParameterDialog createParameterDialog;35 34 /// <summary> 36 35 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". … … 64 63 base.RegisterContentEvents(); 65 64 foreach (IRunCollectionConstraint constraint in Content) 66 constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged);65 RegisterConstraintEvents(constraint); 67 66 } 68 67 protected override void DeregisterContentEvents() { 69 68 base.DeregisterContentEvents(); 70 69 foreach (IRunCollectionConstraint constraint in Content) 71 constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);70 DeregisterConstraintEvents(constraint); 72 71 } 73 72 protected override void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) { 74 73 base.Content_ItemsAdded(sender, e); 75 74 foreach (IRunCollectionConstraint constraint in e.Items) 76 constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged);75 RegisterConstraintEvents(constraint); 77 76 } 78 77 protected override void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) { 79 78 base.Content_ItemsRemoved(sender, e); 80 79 foreach (IRunCollectionConstraint constraint in e.Items) 81 constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);80 DeregisterConstraintEvents(constraint); 82 81 } 83 82 protected override void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) { 84 83 base.Content_CollectionReset(sender, e); 85 84 foreach (IRunCollectionConstraint constraint in e.OldItems) 86 constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged);85 RegisterConstraintEvents(constraint); 87 86 foreach (IRunCollectionConstraint constraint in e.Items) 88 constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged); 87 DeregisterConstraintEvents(constraint); 88 } 89 90 protected virtual void RegisterConstraintEvents(IRunCollectionConstraint constraint) { 91 constraint.ActiveChanged += new EventHandler(constraint_ActiveChanged); 92 } 93 94 protected virtual void DeregisterConstraintEvents(IRunCollectionConstraint constraint) { 95 constraint.ActiveChanged -= new EventHandler(constraint_ActiveChanged); 89 96 } 90 97 … … 99 106 } 100 107 } 108 this.AdjustListViewColumnSizes(); 101 109 } 102 103 104 110 } 105 111 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs
r3614 r3632 95 95 } 96 96 private void run_Changed(object sender, EventArgs e) { 97 IRun run = (IRun)sender; 98 UpdateRun(run); 97 if (InvokeRequired) 98 this.Invoke(new EventHandler(run_Changed), sender, e); 99 else { 100 IRun run = (IRun)sender; 101 UpdateRun(run); 102 } 99 103 } 100 104 … … 104 108 this.dataGridView.Rows[rowIndex].Visible = run.Visible; 105 109 this.dataGridView.Rows[rowIndex].DefaultCellStyle.ForeColor = run.Color; 110 this.rowsTextBox.Text = this.Content.Count(r => r.Visible).ToString(); 106 111 } 107 112 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
r3614 r3632 335 335 } 336 336 protected virtual void Run_Changed(object sender, EventArgs e) { 337 IRun run = (IRun)sender; 338 UpdateRun(run); 337 if (InvokeRequired) 338 this.Invoke(new EventHandler(Run_Changed), sender, e); 339 else { 340 IRun run = (IRun)sender; 341 UpdateRun(run); 342 } 339 343 } 340 344 -
trunk/sources/HeuristicLab.Optimization/3.3/RunCollection.cs
r3625 r3632 84 84 OnColumnNamesChanged(); 85 85 OnRowNamesChanged(); 86 this.UpdateFiltering(false); 86 87 } 87 88 protected override void OnItemsRemoved(IEnumerable<IRun> items) { … … 160 161 public override IDeepCloneable Clone(Cloner cloner) { 161 162 RunCollection clone = (RunCollection)base.Clone(cloner); 162 clone.resultNames = this.resultNames;163 clone.parameterNames = this.parameterNames;163 clone.resultNames = new List<string>(this.resultNames); 164 clone.parameterNames = new List<string>(this.parameterNames); 164 165 clone.dataTypes = new Dictionary<string, HashSet<Type>>(); 165 166 foreach (string s in this.dataTypes.Keys) 166 167 clone.dataTypes[s] = new HashSet<Type>(this.dataTypes[s]); 167 168 168 return clone; 169 169 } … … 252 252 253 253 #region filtering 254 private void UpdateFiltering() { 255 list.ForEach(r => r.Visible = true); 254 private void UpdateFiltering(bool reset) { 255 if (reset) 256 list.ForEach(r => r.Visible = true); 256 257 foreach (IRunCollectionConstraint constraint in this.constraints) 257 258 constraint.Check(); … … 278 279 DeregisterConstraintEvents(e.OldItems); 279 280 RegisterConstraintEvents(e.Items); 280 this.UpdateFiltering( );281 this.UpdateFiltering(true); 281 282 } 282 283 protected virtual void Constraints_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) { … … 284 285 foreach (IRunCollectionConstraint constraint in e.Items) 285 286 constraint.ConstrainedValue = this; 286 this.UpdateFiltering( );287 this.UpdateFiltering(false); 287 288 } 288 289 protected virtual void Constraints_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRunCollectionConstraint> e) { 289 290 DeregisterConstraintEvents(e.Items); 290 this.UpdateFiltering( );291 this.UpdateFiltering(true); 291 292 } 292 293 protected virtual void Constraint_ActiveChanged(object sender, EventArgs e) { 293 this.UpdateFiltering(); 294 IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender; 295 this.UpdateFiltering(!constraint.Active); 294 296 } 295 297 protected virtual void Constraint_ConstrainedValueChanged(object sender, EventArgs e) { … … 297 299 } 298 300 protected virtual void Constraint_ConstraintOperationChanged(object sender, EventArgs e) { 299 this.UpdateFiltering(); 301 IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender; 302 if (constraint.Active) 303 this.UpdateFiltering(true); 300 304 } 301 305 protected virtual void Constraint_ConstraintDataChanged(object sender, EventArgs e) { 302 this.UpdateFiltering(); 306 IRunCollectionConstraint constraint = (IRunCollectionConstraint)sender; 307 if (constraint.Active) 308 this.UpdateFiltering(true); 303 309 } 304 310 #endregion -
trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs
r3617 r3632 70 70 constraintColumn = value; 71 71 this.OnConstraintColumnChanged(); 72 this.OnToStringChanged(); 72 73 } 73 74 } -
trunk/sources/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionTypeCompatiblityConstraint.cs
r3617 r3632 60 60 constraintColumn = value; 61 61 this.OnConstraintColumnChanged(); 62 this.OnToStringChanged(); 62 63 } 63 64 }
Note: See TracChangeset
for help on using the changeset viewer.