Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/03/10 18:32:57 (15 years ago)
Author:
epitzer
Message:

update to new PluginInfrastructure (#802)

Location:
branches/Persistence Test
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/Persistence Test

  • branches/Persistence Test/HeuristicLab.OptimizationFrontend/3.3/AvailableOperatorsForm.cs

    r1530 r2744  
    2626using System.Data;
    2727using System.Drawing;
     28using System.Linq;
    2829using System.Text;
    2930using System.Windows.Forms;
    3031using HeuristicLab.PluginInfrastructure;
    3132using HeuristicLab.Core;
     33using HeuristicLab.PluginInfrastructure.Manager;
    3234
    3335namespace HeuristicLab.OptimizationFrontend {
     
    5658      builtinOperatorsTreeView.TreeViewNodeSorter = nodeSorter;
    5759
    58       DiscoveryService discoveryService = new DiscoveryService();
    59       PluginInfo[] plugins = discoveryService.Plugins;
    60       foreach(PluginInfo plugin in plugins) {
     60      foreach(PluginDescription plugin in ApplicationManager.Manager.Plugins) {
    6161        TreeNode pluginItem = new TreeNode();
    6262        pluginItem.Text = plugin.Name;
    6363        pluginItem.Tag = plugin;
    6464
    65         Type[] operators = discoveryService.GetTypes(typeof(IOperator), plugin);
     65        Type[] operators = ApplicationManager.Manager.GetTypes(typeof(IOperator), plugin).ToArray();
    6666        foreach(Type type in operators) {
    6767          if(!type.IsAbstract) {
  • branches/Persistence Test/HeuristicLab.OptimizationFrontend/3.3/HeuristicLabOptimizationFrontendApplication.cs

    r1872 r2744  
    2727
    2828namespace HeuristicLab.OptimizationFrontend {
    29   [ClassInfo(Name = "HeuristicLab 3.3", Description="Next generation heuristic optimization environment.")]
     29  [Application("HeuristicLab 3.3", "Next generation heuristic optimization environment.")]
    3030  class HeuristicLabOptimizationFrontendApplication : ApplicationBase {
    3131    public override void Run() {
    3232      Form mainForm = new MainForm();
    33       PluginManager.ControlManager = (IControlManager)mainForm;
     33      ControlManager.RegisterManager((IControlManager)mainForm);
    3434      Application.Run(mainForm);
    3535    }
  • branches/Persistence Test/HeuristicLab.OptimizationFrontend/3.3/HeuristicLabOptimizationFrontendPlugin.cs

    r1872 r2744  
    2727
    2828namespace HeuristicLab.OptimizationFrontend {
    29   [ClassInfo(Name = "HeuristicLab.OptimizationFrontend-3.3")]
    30   [PluginFile(Filename = "HeuristicLab.OptimizationFrontend-3.3.dll", Filetype = PluginFileType.Assembly)]
    31   [Dependency(Dependency = "HeuristicLab.Core-3.3")]
     29  [Plugin("HeuristicLab.OptimizationFrontend-3.3")]
     30  [PluginFile("HeuristicLab.OptimizationFrontend-3.3.dll", PluginFileType.Assembly)]
     31  [PluginDependency("HeuristicLab.Core-3.3")]
    3232  public class HeuristicLabOptimizationFrontendPlugin : PluginBase {
    3333  }
  • branches/Persistence Test/HeuristicLab.OptimizationFrontend/3.3/MainForm.cs

    r1530 r2744  
    2525using System.Data;
    2626using System.Drawing;
     27using System.Linq;
    2728using System.Text;
    2829using System.Threading;
     
    5859      runningTasks = 0;
    5960
    60       DiscoveryService discoveryService = new DiscoveryService();
    61 
    6261      // discover creatable items
    63       Type[] creatables = discoveryService.GetTypes(typeof(IEditable));
     62      Type[] creatables = ApplicationManager.Manager.GetTypes(typeof(IEditable)).ToArray();
    6463      string[] names = new string[creatables.Length];
    6564      for(int i = 0; i < creatables.Length; i++)
     
    8483
    8584    #region IControlManager Members
    86     public void ShowControl(IControl control) {
     85    public void ShowControl(object control) {
    8786      if(control is IEditor) {
    8887        EditorForm form = new EditorForm((IEditor)control);
     
    171170        else {
    172171          editor.Filename = task.filename;
    173           PluginManager.ControlManager.ShowControl(editor);
     172          ControlManager.Manager.ShowControl(editor);
    174173        }
    175174        lock(locker) {
     
    234233          MessageBox.Show("The selected item doesn't provide an editor.", "Editor Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    235234        } else {
    236           PluginManager.ControlManager.ShowControl(editor);
     235          ControlManager.Manager.ShowControl(editor);
    237236          EnableDisableItems();
    238237        }
Note: See TracChangeset for help on using the changeset viewer.