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.OptimizationFrontend/3.2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.OptimizationFrontend/3.2/AvailableOperatorsForm.cs

    r1530 r2591  
    5656      builtinOperatorsTreeView.TreeViewNodeSorter = nodeSorter;
    5757
    58       DiscoveryService discoveryService = new DiscoveryService();
    59       PluginInfo[] plugins = discoveryService.Plugins;
    60       foreach(PluginInfo plugin in plugins) {
     58      foreach(IPluginDescription plugin in ApplicationManager.Manager.Plugins) {
    6159        TreeNode pluginItem = new TreeNode();
    6260        pluginItem.Text = plugin.Name;
    6361        pluginItem.Tag = plugin;
    6462
    65         Type[] operators = discoveryService.GetTypes(typeof(IOperator), plugin);
    66         foreach(Type type in operators) {
     63        foreach(Type type in ApplicationManager.Manager.GetTypes(typeof(IOperator), plugin)) {
    6764          if(!type.IsAbstract) {
    6865            TreeNode operatorItem = new TreeNode();
  • trunk/sources/HeuristicLab.OptimizationFrontend/3.2/HeuristicLab.OptimizationFrontend-3.2.csproj

    r1534 r2591  
    1111    <RootNamespace>HeuristicLab.OptimizationFrontend</RootNamespace>
    1212    <AssemblyName>HeuristicLab.OptimizationFrontend-3.2</AssemblyName>
    13     <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
    1515    <SignAssembly>true</SignAssembly>
     
    7070  <ItemGroup>
    7171    <Reference Include="System" />
     72    <Reference Include="System.Core">
     73      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     74    </Reference>
    7275    <Reference Include="System.Data" />
    7376    <Reference Include="System.Drawing" />
  • trunk/sources/HeuristicLab.OptimizationFrontend/3.2/HeuristicLabOptimizationFrontendApplication.cs

    r1530 r2591  
    2727
    2828namespace HeuristicLab.OptimizationFrontend {
    29   [ClassInfo(Name = "HeuristicLab 3.2", Description="Next generation heuristic optimization environment.")]
     29  [Application("HeuristicLab 3.2", "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    }
  • trunk/sources/HeuristicLab.OptimizationFrontend/3.2/HeuristicLabOptimizationFrontendPlugin.cs

    r1530 r2591  
    2727
    2828namespace HeuristicLab.OptimizationFrontend {
    29   [ClassInfo(Name = "HeuristicLab.OptimizationFrontend-3.2")]
    30   [PluginFile(Filename = "HeuristicLab.OptimizationFrontend-3.2.dll", Filetype = PluginFileType.Assembly)]
    31   [Dependency(Dependency = "HeuristicLab.Core-3.2")]
     29  [Plugin("HeuristicLab.OptimizationFrontend-3.2")]
     30  [PluginFile("HeuristicLab.OptimizationFrontend-3.2.dll", PluginFileType.Assembly)]
     31  [PluginDependency("HeuristicLab.Core-3.2")]
    3232  public class HeuristicLabOptimizationFrontendPlugin : PluginBase {
    3333  }
  • trunk/sources/HeuristicLab.OptimizationFrontend/3.2/MainForm.cs

    r2576 r2591  
    2626using System.Drawing;
    2727using System.Text;
     28using System.Linq;
    2829using System.Threading;
    2930using System.Windows.Forms;
     
    5859      runningTasks = 0;
    5960
    60       DiscoveryService discoveryService = new DiscoveryService();
    61 
    6261      // discover creatable items
    63       Type[] creatables = discoveryService.GetTypes(typeof(IEditable));
    64       string[] names = new string[creatables.Length];
    65       for (int i = 0; i < creatables.Length; i++)
    66         names[i] = creatables[i].Name;
    67       Array.Sort(names, creatables);
     62      IEnumerable<Type> creatables = from x in ApplicationManager.Manager.GetTypes(typeof(IEditable))
     63                                     orderby x.Name
     64                                     select x;
    6865      foreach (Type type in creatables) {
    6966        if (!type.IsAbstract) {
     
    8481
    8582    #region IControlManager Members
    86     public void ShowControl(IControl control) {
    87       if (InvokeRequired) Invoke((Action<IControl>)ShowControl, control);
     83    public void ShowControl(object control) {
     84      if (InvokeRequired) Invoke((Action<object>)ShowControl, control);
    8885      else {
    8986        if (control is IEditor) {
     
    176173        else {
    177174          editor.Filename = task.filename;
    178           PluginManager.ControlManager.ShowControl(editor);
     175          ControlManager.Manager.ShowControl(editor);
    179176        }
    180177        lock (locker) {
     
    239236          MessageBox.Show("The selected item doesn't provide an editor.", "Editor Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    240237        } else {
    241           PluginManager.ControlManager.ShowControl(editor);
     238          ControlManager.Manager.ShowControl(editor);
    242239          EnableDisableItems();
    243240        }
Note: See TracChangeset for help on using the changeset viewer.