Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/05/10 10:31:40 (15 years ago)
Author:
gkronber
Message:

Copied refactored plugin infrastructure from branch and merged changeset r2586:2589 from branch into the trunk. #799

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Constraints/3.2/NotConstraintView.cs

    r1529 r2591  
    5858    public NotConstraintView() {
    5959      InitializeComponent();
    60       DiscoveryService discoveryService = new DiscoveryService();
    61       itemTypes = discoveryService.GetTypes(typeof(ConstraintBase));
    62       for (int i = 0; i < itemTypes.Length; i++) {
    63         subConstraintComboBox.Items.Add(itemTypes[i].Name);
     60      foreach (Type itemType in ApplicationManager.Manager.GetTypes(typeof(ConstraintBase))) {
     61        subConstraintComboBox.Items.Add(itemType.Name);
    6462      }
    6563      subConstraintComboBox.SelectedIndex = 0;
     
    130128        try {
    131129          NotConstraint.SubConstraint = (ConstraintBase)Activator.CreateInstance(itemTypes[subConstraintComboBox.SelectedIndex]);
    132         } catch (Exception) {
     130        }
     131        catch (Exception) {
    133132          NotConstraint.SubConstraint = null;
    134133        }
     
    144143    private void UpdateSubConstraintComboBox() {
    145144      subConstraintComboBox.SelectedIndexChanged -= new EventHandler(subConstraintComboBox_SelectedIndexChanged);
    146       for (int i = 0 ; i < itemTypes.Length ; i++)
     145      for (int i = 0; i < itemTypes.Length; i++)
    147146        if (itemTypes[i].Name.Equals(NotConstraint.SubConstraint.GetType().Name))
    148147          subConstraintComboBox.SelectedIndex = i;
Note: See TracChangeset for help on using the changeset viewer.