Free cookie consent management tool by TermsFeed Policy Generator

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

Restricted types of child operators in MultiOperator (#979)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorListView.cs

    r3393 r3407  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Collections;
     
    2930  [Content(typeof(IItemList<IOperator>), false)]
    3031  public partial class OperatorListView : ItemListView<IOperator> {
    31     protected TypeSelectorDialog typeSelectorDialog;
    32 
    3332    /// <summary>
    3433    /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View".
     
    5352      if (typeSelectorDialog == null) {
    5453        typeSelectorDialog = new TypeSelectorDialog();
     54        typeSelectorDialog.Caption = "Select Operator";
    5555        typeSelectorDialog.TypeSelector.Caption = "Available Operators";
    5656        typeSelectorDialog.TypeSelector.Configure(typeof(IOperator), false, false);
    5757      }
    5858
    59       if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)
    60         return (IOperator)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    61       else
    62         return null;
     59      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     60        try {
     61          return (IOperator)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     62        }
     63        catch (Exception ex) {
     64          Auxiliary.ShowErrorMessageBox(ex);
     65        }
     66      }
     67      return null;
    6368    }
    6469  }
Note: See TracChangeset for help on using the changeset viewer.