Changeset 4981 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews
- Timestamp:
- 11/28/10 21:42:49 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews
- Files:
-
- 3 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/NumericRangeView.cs
r4839 r4981 16 16 /// The visual representation of a <see cref="IIntegerRange"/>. 17 17 /// </summary> 18 [View(" NumericRange View")]19 [Content(typeof(IRange<IntValue>), true)]18 [View("IntValueRange View")] 19 [Content(typeof(IRange<IntValue>), false)] 20 20 public partial class IntValueRangeView : ItemView { 21 21 /// <summary> -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueConfigurationCheckedItemList.Designer.cs
r4839 r4981 1 1 namespace HeuristicLab.Problems.MetaOptimization.Views { 2 partial class ValueConfigurationCheckedItem List{2 partial class ValueConfigurationCheckedItemCollectionView { 3 3 /// <summary> 4 4 /// Required designer variable. -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueConfigurationCheckedItemList.cs
r4839 r4981 9 9 using HeuristicLab.MainForm; 10 10 using HeuristicLab.Core; 11 using System.Windows.Forms; 12 using HeuristicLab.PluginInfrastructure; 11 13 12 14 namespace HeuristicLab.Problems.MetaOptimization.Views { 13 15 [View("ValueConfigurationList View")] 14 [Content(typeof(CheckedItemList<IValueConfiguration>), true)] 15 [Content(typeof(ICheckedItemList<IValueConfiguration>), true)] 16 public partial class ValueConfigurationCheckedItemList : CheckedItemListView<IValueConfiguration> { 17 public ValueConfigurationCheckedItemList() { 16 [Content(typeof(ICheckedValueConfigurationCollection), IsDefaultView = true)] 17 public sealed partial class ValueConfigurationCheckedItemCollectionView : CheckedItemCollectionView<IValueConfiguration> { 18 public new ICheckedValueConfigurationCollection Content { 19 get { return (ICheckedValueConfigurationCollection)base.Content; } 20 set { base.Content = value; } 21 } 22 23 public ValueConfigurationCheckedItemCollectionView() { 18 24 InitializeComponent(); 25 } 26 27 protected override void DeregisterContentEvents() { 28 // TODO: Deregister your event handlers here 29 base.DeregisterContentEvents(); 30 } 31 32 protected override void RegisterContentEvents() { 33 base.RegisterContentEvents(); 34 // TODO: Register your event handlers here 35 } 36 37 #region Event Handlers (Content) 38 // TODO: Put event handlers of the content here 39 #endregion 40 41 protected override void OnContentChanged() { 42 base.OnContentChanged(); 43 if (Content == null) { 44 // TODO: Add code when content has been changed and is null 45 } else { 46 // TODO: Add code when content has been changed and is not null 47 } 48 } 49 50 51 protected override void SetEnabledStateOfControls() { 52 base.SetEnabledStateOfControls(); 53 // TODO: Enable or disable controls based on whether the content is null or the view is set readonly 54 } 55 56 #region Event Handlers (child controls) 57 // TODO: Put event handlers of child controls here. 58 #endregion 59 60 protected override IValueConfiguration CreateItem() { 61 if (typeSelectorDialog == null) { 62 typeSelectorDialog = new TypeSelectorDialog(); 63 typeSelectorDialog.Caption = "Select Item"; 64 typeSelectorDialog.TypeSelector.Caption = "Available Items"; 65 typeSelectorDialog.TypeSelector.Configure(Content.ValueDataType, false, true); 66 } 67 68 if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) { 69 try { 70 IItem value = (IItem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType(); 71 return new ValueConfiguration(value, value.GetType()); 72 } 73 catch (Exception ex) { 74 ErrorHandling.ShowErrorDialog(this, ex); 75 } 76 } 77 return null; 19 78 } 20 79 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueView.cs
r4839 r4981 15 15 namespace HeuristicLab.Problems.MetaOptimization.Views { 16 16 [View("Value View")] 17 [Content(typeof( IValueConfiguration), false)]17 [Content(typeof(ConstrainedValue), true)] 18 18 public partial class ValueView : ItemView { 19 19 20 public new IValueConfigurationContent {21 get { return ( IValueConfiguration)base.Content; }20 public new ConstrainedValue Content { 21 get { return (ConstrainedValue)base.Content; } 22 22 set { base.Content = value; } 23 23 }
Note: See TracChangeset
for help on using the changeset viewer.