Changeset 3604
- Timestamp:
- 05/04/10 14:20:10 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ConstraintCollectionView.Designer.cs
r3601 r3604 1 1 namespace HeuristicLab.Core.Views { 2 partial class ParameterCollectionView {2 partial class ConstraintCollectionView { 3 3 /// <summary> 4 4 /// Required designer variable. -
trunk/sources/HeuristicLab.Core.Views/3.3/ConstraintCollectionView.cs
r3601 r3604 26 26 27 27 namespace HeuristicLab.Core.Views { 28 [View(" ParameterCollection View")]29 [Content(typeof( ParameterCollection), true)]30 [Content(typeof(I KeyedItemCollection<string, IParameter>), false)]31 public partial class ParameterCollectionView : NamedItemCollectionView<IParameter> {28 [View("ConstraintCollection View")] 29 [Content(typeof(ConstraintCollection), true)] 30 [Content(typeof(IItemCollection<IConstraint>), false)] 31 public partial class ConstraintCollectionView : ItemCollectionView<IConstraint> { 32 32 protected CreateParameterDialog createParameterDialog; 33 33 /// <summary> 34 34 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". 35 35 /// </summary> 36 public ParameterCollectionView() {36 public ConstraintCollectionView() { 37 37 InitializeComponent(); 38 Caption = " ParameterCollection";39 itemsGroupBox.Text = " Parameters";38 Caption = "ConstraintCollection"; 39 itemsGroupBox.Text = "Constraints"; 40 40 } 41 41 42 protected override IParameter CreateItem() { 43 if (createParameterDialog == null) createParameterDialog = new CreateParameterDialog(); 42 protected override IConstraint CreateItem() { 43 if (typeSelectorDialog == null) { 44 typeSelectorDialog = new TypeSelectorDialog(); 45 typeSelectorDialog.Caption = "Select Operator"; 46 typeSelectorDialog.TypeSelector.Caption = "Available Operators"; 47 typeSelectorDialog.TypeSelector.Configure(typeof(IConstraint), false, true); 48 } 44 49 45 if (createParameterDialog.ShowDialog(this) == DialogResult.OK) { 46 IParameter param = createParameterDialog.Parameter; 47 if ((param != null) && Content.ContainsKey(param.Name)) 48 param = (IParameter)Activator.CreateInstance(param.GetType(), GetUniqueName(param.Name), param.Description); 49 return param; 50 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) { 51 try { 52 return (IConstraint)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 53 } 54 catch (Exception ex) { 55 Auxiliary.ShowErrorMessageBox(ex); 56 } 50 57 } 51 58 return null; -
trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj
r3566 r3604 105 105 <DependentUpon>CheckedItemListView.cs</DependentUpon> 106 106 </Compile> 107 <Compile Include="ConstraintCollectionView.cs"> 108 <SubType>UserControl</SubType> 109 </Compile> 110 <Compile Include="ConstraintCollectionView.Designer.cs"> 111 <DependentUpon>ConstraintCollectionView.cs</DependentUpon> 112 </Compile> 107 113 <Compile Include="LogView.cs"> 108 114 <SubType>UserControl</SubType>
Note: See TracChangeset
for help on using the changeset viewer.