Changeset 3632 for trunk/sources/HeuristicLab.Optimization.Views
- Timestamp:
- 05/05/10 14:04:53 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.