Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/10 03:28:16 (15 years ago)
Author:
swagner
Message:

Restricted types of child operators in MultiOperator (#979)

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs

    r3367 r3407  
    176176        problemTypeSelectorDialog = new TypeSelectorDialog();
    177177        problemTypeSelectorDialog.Caption = "Select Problem";
     178        problemTypeSelectorDialog.TypeSelector.Caption = "Available Problems";
    178179        problemTypeSelectorDialog.TypeSelector.Configure(Content.ProblemType, false, false);
    179180      }
    180181      if (problemTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    181         Content.Problem = (IProblem)problemTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     182        try {
     183          Content.Problem = (IProblem)problemTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     184        }
     185        catch (Exception ex) {
     186          Auxiliary.ShowErrorMessageBox(ex);
     187        }
    182188      }
    183189    }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs

    r3367 r3407  
    166166        algorithmTypeSelectorDialog = new TypeSelectorDialog();
    167167        algorithmTypeSelectorDialog.Caption = "Select Algorithm";
     168        algorithmTypeSelectorDialog.TypeSelector.Caption = "Available Algorithms";
    168169        algorithmTypeSelectorDialog.TypeSelector.Configure(typeof(IAlgorithm), false, false);
    169170      }
    170171      if (algorithmTypeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
    171         Content.Algorithm = (IAlgorithm)algorithmTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     172        try {
     173          Content.Algorithm = (IAlgorithm)algorithmTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     174        }
     175        catch (Exception ex) {
     176          Auxiliary.ShowErrorMessageBox(ex);
     177        }
    172178      }
    173179    }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/OptimizerListView.Designer.cs

    r3274 r3407  
    3333    protected override void Dispose(bool disposing) {
    3434      if (disposing) {
    35         if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
    3635        if (components != null) components.Dispose();
    3736      }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/OptimizerListView.cs

    r3393 r3407  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Collections;
     
    3132  [Content(typeof(IItemList<IOptimizer>), false)]
    3233  public partial class OptimizerListView : ItemListView<IOptimizer> {
    33     protected TypeSelectorDialog typeSelectorDialog;
    34 
    3534    /// <summary>
    3635    /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View".
     
    5554      if (typeSelectorDialog == null) {
    5655        typeSelectorDialog = new TypeSelectorDialog();
     56        typeSelectorDialog.Caption = "Select Optimizer";
    5757        typeSelectorDialog.TypeSelector.Caption = "Available Optimizers";
    5858        typeSelectorDialog.TypeSelector.Configure(typeof(IOptimizer), false, false);
    5959      }
    6060
    61       if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)
    62         return typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType() as IOptimizer;
    63       else
    64         return null;
     61      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     62        try {
     63          return (IOptimizer)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     64        }
     65        catch (Exception ex) {
     66          Auxiliary.ShowErrorMessageBox(ex);
     67        }
     68      }
     69      return null;
    6570    }
    6671  }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/ResultCollectionView.cs

    r3393 r3407  
    5656
    5757    protected override IResult CreateItem() {
    58       IResult item = new Result();
    59       if (Content.ContainsKey(item.Name))
    60         item = new Result(GetUniqueName(item.Name), typeof(IItem));
    61       return item;
     58      return null;
    6259    }
    6360  }
Note: See TracChangeset for help on using the changeset viewer.