Changeset 17887 for branches/3073_IA_constraint_splitting_reintegration/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataConstraintView.cs
- Timestamp:
- 03/12/21 14:00:36 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3073_IA_constraint_splitting_reintegration/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataConstraintView.cs
r17607 r17887 32 32 namespace HeuristicLab.Problems.DataAnalysis.Views { 33 33 [View("ParsedConstraint View")] 34 [Content(typeof( ProblemDataConstraint), true)]34 [Content(typeof(ShapeConstraints), true)] 35 35 public partial class ProblemDataConstraintView : AsynchronousContentView { 36 private readonly CheckedItemList< IntervalConstraint>37 intervalConstraints = new CheckedItemList< IntervalConstraint>();36 private readonly CheckedItemList<ShapeConstraint> 37 intervalConstraints = new CheckedItemList<ShapeConstraint>(); 38 38 39 public new ProblemDataConstraintContent {40 get => ( ProblemDataConstraint) base.Content;39 public new ShapeConstraints Content { 40 get => (ShapeConstraints) base.Content; 41 41 set => base.Content = value; 42 42 } … … 73 73 74 74 75 private IEnumerable< IntervalConstraint> ParseConstraints(string input) {76 return IntervalConstraintsParser.ParseInput(input, Content.ProblemData.TargetVariable,75 private IEnumerable<ShapeConstraint> ParseConstraints(string input) { 76 return ShapeConstraintsParser.ParseInput(input, Content.ProblemData.TargetVariable, 77 77 Content.ProblemData.AllowedInputVariables); 78 78 } … … 90 90 } 91 91 catch (ArgumentException ex) { 92 Content.Constraints = new List< IntervalConstraint>();92 Content.Constraints = new List<ShapeConstraint>(); 93 93 Content.InfoText = ex.Message.Replace("Parameter name", "@Line"); 94 94 Content.InfoColor = Color.DarkRed; … … 117 117 118 118 private void constraint_Changed(object sender, EventArgs e) { 119 var constraint = ( IntervalConstraint) sender;119 var constraint = (ShapeConstraint) sender; 120 120 intervalConstraints.SetItemCheckedState(constraint, constraint.Enabled); 121 121 } 122 122 123 123 private void constraints_Updated(object sender, 124 CollectionItemsChangedEventArgs<IndexedItem< IntervalConstraint>> e) {124 CollectionItemsChangedEventArgs<IndexedItem<ShapeConstraint>> e) { 125 125 foreach (var addedItem in e.Items) addedItem.Value.Changed += constraint_Changed; 126 126 } 127 127 128 private void constraint_removed(object sender, CollectionItemsChangedEventArgs<IndexedItem< IntervalConstraint>> e) {128 private void constraint_removed(object sender, CollectionItemsChangedEventArgs<IndexedItem<ShapeConstraint>> e) { 129 129 foreach (var removedItem in e.Items) removedItem.Value.Changed -= constraint_Changed; 130 130 } 131 131 132 132 private void constraint_CheckedItemChanged(object sender, 133 CollectionItemsChangedEventArgs<IndexedItem< IntervalConstraint>> e) {134 ICheckedItemList< IntervalConstraint> checkedItemList = (ICheckedItemList<IntervalConstraint>) sender;133 CollectionItemsChangedEventArgs<IndexedItem<ShapeConstraint>> e) { 134 ICheckedItemList<ShapeConstraint> checkedItemList = (ICheckedItemList<ShapeConstraint>) sender; 135 135 foreach (var indexedItem in e.Items) indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value); 136 136 }
Note: See TracChangeset
for help on using the changeset viewer.