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

Location:
trunk/sources/HeuristicLab.Constraints/3.2
Files:
2 edited

Legend:

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

    r1927 r2591  
    2929  /// Plugin class for HeuristicLab.Constraints plugin.
    3030  /// </summary>
    31   [ClassInfo(Name = "HeuristicLab.Constraints-3.2")]
    32   [PluginFile(Filename = "HeuristicLab.Constraints-3.2.dll", Filetype = PluginFileType.Assembly)]
    33   [Dependency(Dependency = "HeuristicLab.Core-3.2")]
    34   [Dependency(Dependency = "HeuristicLab.Data-3.2")]
     31  [Plugin("HeuristicLab.Constraints-3.2")]
     32  [PluginFile("HeuristicLab.Constraints-3.2.dll", PluginFileType.Assembly)]
     33  [PluginDependency("HeuristicLab.Core-3.2")]
     34  [PluginDependency("HeuristicLab.Data-3.2")]
    3535  public class HeuristicLabConstraintsPlugin : PluginBase {
    3636  }
  • 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.