using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using HeuristicLab.MainForm; using HeuristicLab.Collections; namespace HeuristicLab.Core.Views { [Content(typeof(OperatorSet), true)] [Content(typeof(IObservableSet), false)] public partial class OperatorSetView : ItemSetView { protected TypeSelectorDialog typeSelectorDialog; /// /// Initializes a new instance of with caption "Variables Scope View". /// public OperatorSetView() { InitializeComponent(); Caption = "Operator Set"; itemsGroupBox.Text = "&Operators"; } /// /// Initializes a new instance of with /// the given . /// /// Calls . /// The scope whose variables should be represented visually. public OperatorSetView(IObservableSet content) : this() { Content = content; } protected override IOperator CreateItem() { if (typeSelectorDialog == null) { typeSelectorDialog = new TypeSelectorDialog(); typeSelectorDialog.TypeSelector.Caption = "&Available Operators"; typeSelectorDialog.TypeSelector.Configure(typeof(IOperator), false, false); } if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) return (IOperator)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); else return null; } } }