Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16938


Ignore:
Timestamp:
05/09/19 14:31:29 (6 years ago)
Author:
chaider
Message:

#2971 Added Changed event for ProblemDataConstraint

  • Updated parseBtn_Click
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs

    r16918 r16938  
    5151      intervalConstraints.CheckedItemsChanged += constraint_CheckedItemChanged;
    5252      intervalConstraints.ItemsAdded += constraints_Updated;
    53       intervalConstraints.ItemsRemoved += constraint_removed;
     53      intervalConstraints.ItemsRemoved += constraint_removed;
     54      Content.Changed += Content_Changed;
    5455    }
    5556
     
    5859      intervalConstraints.ItemsAdded -= constraints_Updated;
    5960      intervalConstraints.ItemsRemoved -= constraint_removed;
     61      Content.Changed -= Content_Changed;
    6062      base.DeregisterContentEvents();
    6163    }
     
    7173        intervalConstraints.Clear();
    7274        var parsedConstraints = ParseConstraints(constraintsInput.Text);
    73         foreach (var constraint in parsedConstraints) {
    74           intervalConstraints.Add(constraint, constraint.Enabled);
    75         }
    76         constraintsOutput.Content = intervalConstraints;
    77         Content.Constraints = intervalConstraints;
     75        Content.Constraints = parsedConstraints;
    7876        Content.Input = constraintsInput.Text;
    7977        errorOutput.Text = "";
     
    8684      if (Content == null) {
    8785        intervalConstraints.Clear();
    88         constraintsOutput.Content = intervalConstraints.AsReadOnly();
     86        constraintsOutput.Content = intervalConstraints;
    8987      } else {
    9088        intervalConstraints.Clear();
     
    9492        }
    9593
    96         constraintsOutput.Content = intervalConstraints.AsReadOnly();
     94        constraintsOutput.Content = intervalConstraints;
    9795      }
    9896    }
     
    127125    }
    128126
     127    private void Content_Changed(object sender, EventArgs e) {
     128      UpdateControl();
     129    }
     130
    129131  }
    130132}
Note: See TracChangeset for help on using the changeset viewer.