Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/28/10 21:42:49 (14 years ago)
Author:
cneumuel
Message:

#1215 worked on metaoptimization

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  
    1616  /// The visual representation of a <see cref="IIntegerRange"/>.
    1717  /// </summary>
    18   [View("NumericRange View")]
    19   [Content(typeof(IRange<IntValue>), true)]
     18  [View("IntValueRange View")]
     19  [Content(typeof(IRange<IntValue>), false)]
    2020  public partial class IntValueRangeView : ItemView {
    2121    /// <summary>
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueConfigurationCheckedItemList.Designer.cs

    r4839 r4981  
    11namespace HeuristicLab.Problems.MetaOptimization.Views {
    2   partial class ValueConfigurationCheckedItemList {
     2  partial class ValueConfigurationCheckedItemCollectionView {
    33    /// <summary>
    44    /// Required designer variable.
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueConfigurationCheckedItemList.cs

    r4839 r4981  
    99using HeuristicLab.MainForm;
    1010using HeuristicLab.Core;
     11using System.Windows.Forms;
     12using HeuristicLab.PluginInfrastructure;
    1113
    1214namespace HeuristicLab.Problems.MetaOptimization.Views {
    1315  [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() {
    1824      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;
    1978    }
    2079  }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ValueConfigurationViews/ValueView.cs

    r4839 r4981  
    1515namespace HeuristicLab.Problems.MetaOptimization.Views {
    1616  [View("Value View")]
    17   [Content(typeof(IValueConfiguration), false)]
     17  [Content(typeof(ConstrainedValue), true)]
    1818  public partial class ValueView : ItemView {
    1919
    20     public new IValueConfiguration Content {
    21       get { return (IValueConfiguration)base.Content; }
     20    public new ConstrainedValue Content {
     21      get { return (ConstrainedValue)base.Content; }
    2222      set { base.Content = value; }
    2323    }
Note: See TracChangeset for help on using the changeset viewer.