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.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.