Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/18/10 00:53:15 (13 years ago)
Author:
cneumuel
Message:

#1215 worked on metaoptimization

Location:
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3
Files:
6 added
3 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/HeuristicLab.Problems.MetaOptimization.Views-3.3.csproj

    r4516 r4830  
    8383  </ItemGroup>
    8484  <ItemGroup>
     85    <Compile Include="RootParameterConfigurationView.cs">
     86      <SubType>UserControl</SubType>
     87    </Compile>
     88    <Compile Include="RootParameterConfigurationView.Designer.cs">
     89      <DependentUpon>RootParameterConfigurationView.cs</DependentUpon>
     90    </Compile>
    8591    <Compile Include="NumericRangeView.cs">
    8692      <SubType>UserControl</SubType>
     
    101107      <DependentUpon>ParameterConfigurationListView.cs</DependentUpon>
    102108    </Compile>
    103     <Compile Include="NumericParameterConfigurationView.cs">
    104       <SubType>UserControl</SubType>
    105     </Compile>
    106     <Compile Include="NumericParameterConfigurationView.Designer.cs">
    107       <DependentUpon>NumericParameterConfigurationView.cs</DependentUpon>
    108     </Compile>
    109109    <Compile Include="HeuristicLabProblemsMetaOptimizationViewsPlugin.cs" />
    110110    <Compile Include="ParameterConfigurationView.cs">
     
    115115    </Compile>
    116116    <Compile Include="Properties\AssemblyInfo.cs" />
     117    <Compile Include="ValueView.cs">
     118      <SubType>UserControl</SubType>
     119    </Compile>
     120    <Compile Include="ValueView.Designer.cs">
     121      <DependentUpon>ValueView.cs</DependentUpon>
     122    </Compile>
    117123  </ItemGroup>
    118124  <ItemGroup>
     
    127133  </ItemGroup>
    128134  <ItemGroup>
     135    <EmbeddedResource Include="RootParameterConfigurationView.resx">
     136      <DependentUpon>RootParameterConfigurationView.cs</DependentUpon>
     137    </EmbeddedResource>
    129138    <EmbeddedResource Include="NumericRangeView.resx">
    130139      <DependentUpon>NumericRangeView.cs</DependentUpon>
     
    136145      <DependentUpon>ParameterConfigurationListView.cs</DependentUpon>
    137146    </EmbeddedResource>
    138     <EmbeddedResource Include="NumericParameterConfigurationView.resx">
    139       <DependentUpon>NumericParameterConfigurationView.cs</DependentUpon>
    140     </EmbeddedResource>
    141147    <EmbeddedResource Include="ParameterConfigurationView.resx">
    142148      <DependentUpon>ParameterConfigurationView.cs</DependentUpon>
     149    </EmbeddedResource>
     150    <EmbeddedResource Include="ValueView.resx">
     151      <DependentUpon>ValueView.cs</DependentUpon>
    143152    </EmbeddedResource>
    144153  </ItemGroup>
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/NumericRangeView.Designer.cs

    r4516 r4830  
    11namespace HeuristicLab.Problems.MetaOptimization.Views {
    2   partial class NumericRangeView {
     2  partial class IntValueRangeView {
    33    /// <summary>
    44    /// Required designer variable.
     
    5656      this.lowerValueView.Caption = "StringConvertibleValue View";
    5757      this.lowerValueView.Content = null;
     58      this.lowerValueView.LabelVisible = true;
    5859      this.lowerValueView.Location = new System.Drawing.Point(38, 0);
    5960      this.lowerValueView.Name = "lowerValueView";
     
    6869      this.upperValueView.Caption = "StringConvertibleValue View";
    6970      this.upperValueView.Content = null;
     71      this.upperValueView.LabelVisible = true;
    7072      this.upperValueView.Location = new System.Drawing.Point(38, 29);
    7173      this.upperValueView.Name = "upperValueView";
     
    8991      this.stepSizeValueView.Caption = "StringConvertibleValue View";
    9092      this.stepSizeValueView.Content = null;
     93      this.stepSizeValueView.LabelVisible = true;
    9194      this.stepSizeValueView.Location = new System.Drawing.Point(38, 58);
    9295      this.stepSizeValueView.Name = "stepSizeValueView";
     
    9598      this.stepSizeValueView.TabIndex = 5;
    9699      //
    97       // NumericRangeView
     100      // IntValueRangeView
    98101      //
    99102      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    105108      this.Controls.Add(this.upperValueView);
    106109      this.Controls.Add(this.lowerValueView);
    107       this.Name = "NumericRangeView";
    108       this.Size = new System.Drawing.Size(434, 145);
     110      this.Name = "IntValueRangeView";
     111      this.Size = new System.Drawing.Size(434, 85);
    109112      this.ResumeLayout(false);
    110113      this.PerformLayout();
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/NumericRangeView.cs

    r4516 r4830  
    1414namespace HeuristicLab.Problems.MetaOptimization.Views {
    1515  /// <summary>
    16   /// The visual representation of a <see cref="INumericRange"/>.
     16  /// The visual representation of a <see cref="IIntegerRange"/>.
    1717  /// </summary>
    1818  [View("NumericRange View")]
    19   [Content(typeof(INumericRange), true)]
    20   public partial class NumericRangeView : ItemView {
     19  [Content(typeof(IRange<IntValue>), true)]
     20  public partial class IntValueRangeView : ItemView {
    2121    /// <summary>
    2222    /// Gets or sets the variable to represent visually.
     
    2424    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
    2525    /// No own data storage present.</remarks>
    26     public new INumericRange Content {
    27       get { return (INumericRange)base.Content; }
     26    public new IRange<IntValue> Content {
     27      get { return (IRange<IntValue>)base.Content; }
    2828      set { base.Content = value; }
    2929    }
    3030
    31     public NumericRangeView() {
     31    public IntValueRangeView() {
    3232      InitializeComponent();
    3333    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ObjectSelectorDialog.cs

    r4516 r4830  
    1313    private bool initialized;
    1414    private List<IItem> items;
    15     private IEnumerable<IGrouping<string, T>> selectableItems;
     15    private IEnumerable<IGrouping<Type, T>> selectableItems;
    1616
    1717    private T item;
     
    2020    }
    2121
    22     public ObjectSelectorDialog(IEnumerable<IGrouping<string, T>> selectableItems) {
     22    public ObjectSelectorDialog(IEnumerable<IGrouping<Type, T>> selectableItems) {
    2323      this.initialized = false;
    2424      this.items = new List<IItem>();
     
    3232        itemsListView.SmallImageList = new ImageList();
    3333
    34         foreach (IGrouping<string, T> category in selectableItems) {
    35           ListViewGroup group = new ListViewGroup(category.Key);
     34        foreach (IGrouping<Type, T> item in selectableItems) {
     35          ListViewGroup group = new ListViewGroup(item.Key.Name);
    3636          itemsListView.Groups.Add(group);
    37           foreach (T i in category) {
     37          foreach (T i in item) {
    3838            items.Add(i);
    39             ListViewItem item = new ListViewItem(new string[] { i.Name, i.Description, i.ItemName }, group);
     39            ListViewItem value = new ListViewItem(new string[] { i.Name, i.Description, i.ItemName }, group);
    4040            itemsListView.SmallImageList.Images.Add(i.ItemImage);
    41             item.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
    42             item.Tag = i;
    43             itemsListView.Items.Add(item);
     41            value.ImageIndex = itemsListView.SmallImageList.Images.Count - 1;
     42            value.Tag = i;
     43            itemsListView.Items.Add(value);
    4444          }
    4545        }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ParameterConfigurationListView.cs

    r4516 r4830  
    1111using HeuristicLab.Core;
    1212using HeuristicLab.PluginInfrastructure;
     13using HeuristicLab.Collections;
    1314
    1415namespace HeuristicLab.Problems.MetaOptimization.Views {
     
    1718  /// </summary>
    1819  [View("ParameterConfigurationList View")]
    19   [Content(typeof(ParameterConfigurationList), true)]
     20  [Content(typeof(IItemList<IParameterConfiguration>), true)]
    2021  public partial class ParameterConfigurationListView : ItemCollectionView<IParameterConfiguration> {
    2122    /// <summary>
     
    2425    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
    2526    /// No own data storage present.</remarks>
    26     public new ParameterConfigurationList Content {
    27       get { return (ParameterConfigurationList)base.Content; }
     27    public new IItemList<IParameterConfiguration> Content {
     28      get { return (IItemList<IParameterConfiguration>)base.Content; }
    2829      set { base.Content = value; }
    2930    }
     
    3536    protected override void RegisterContentEvents() {
    3637      base.RegisterContentEvents();
    37       Content.CheckedItemsChanged += new Collections.CollectionItemsChangedEventHandler<IParameterConfiguration>(Content_CheckedItemsChanged);
    3838    }
    3939
    4040    protected override void DeregisterContentEvents() {
    41       Content.CheckedItemsChanged -= new Collections.CollectionItemsChangedEventHandler<IParameterConfiguration>(Content_CheckedItemsChanged);
    4241      base.DeregisterContentEvents();
    4342    }
     
    4544    protected override void OnContentChanged() {
    4645      base.OnContentChanged();
    47       while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]);
    48       viewHost.Content = null;
    49       if (Content != null) {
    50         Caption += " (" + Content.GetType().Name + ")";
    51         foreach (IParameterConfiguration item in Content.CheckedItems)
    52           AddListViewItem(CreateListViewItem(item));
    53         AdjustListViewColumnSizes();
    54         SortItemsListView(SortOrder.Ascending);
    55       }
    5646    }
    57 
    58     protected override void SetEnabledStateOfControls() {
    59       base.SetEnabledStateOfControls();
    60     }
    61 
    62     protected override void addButton_Click(object sender, EventArgs e) {
    63       var selectorDialog = new ObjectSelectorDialog<IParameterConfiguration>(from c in Content
    64                                                                              where !Content.ItemChecked(c)
    65                                                                              group c by c.Category);
    66       if (selectorDialog.ShowDialog() == DialogResult.OK) {
    67         Content.SetItemCheckedState(selectorDialog.Item, true);
    68       }
    69     }
    70 
    71     protected override void removeButton_Click(object sender, EventArgs e) {
    72       if (itemsListView.SelectedItems.Count > 0) {
    73         foreach (ListViewItem item in itemsListView.SelectedItems)
    74           Content.SetItemCheckedState((IParameterConfiguration)item.Tag, false);
    75         itemsListView.SelectedItems.Clear();
    76       }
    77     }
    78 
    79     private void Content_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IParameterConfiguration> e) {
    80       foreach (IParameterConfiguration item in e.Items) {
    81         if (!Content.ItemChecked(item)) {
    82           ListViewItem found = FindListViewItem(item);
    83           if(found != null)
    84             RemoveListViewItem(found);
    85         } else {
    86           ListViewItem found = FindListViewItem(item);
    87           if (found == null)
    88             AddListViewItem(CreateListViewItem(item));
    89         }
    90       }
    91     }
    92 
    93     #region Helpers
    94     private ListViewItem FindListViewItem(IParameterConfiguration tag) {
    95       foreach (ListViewItem item in itemsListView.Items) {
    96         if (item.Tag == tag)
    97           return item;
    98       }
    99       return null;
    100     }
    101     #endregion
    10247  }
    10348}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ParameterConfigurationView.Designer.cs

    r4516 r4830  
    2525    private void InitializeComponent() {
    2626      this.optimizeCheckBox = new System.Windows.Forms.CheckBox();
    27       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     27      this.tabControl = new System.Windows.Forms.TabControl();
     28      this.valueTabPage = new System.Windows.Forms.TabPage();
     29      this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     30      this.configurationtabPage = new System.Windows.Forms.TabPage();
     31      this.configurationViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     32      this.childParameterTabPage = new System.Windows.Forms.TabPage();
     33      this.childParameterConfigurationListView = new HeuristicLab.Problems.MetaOptimization.Views.ParameterConfigurationListView();
     34      this.tabControl.SuspendLayout();
     35      this.valueTabPage.SuspendLayout();
     36      this.configurationtabPage.SuspendLayout();
     37      this.childParameterTabPage.SuspendLayout();
    2838      this.SuspendLayout();
    2939      //
     
    3949      this.optimizeCheckBox.CheckedChanged += new System.EventHandler(this.optimizeCheckBox_CheckedChanged);
    4050      //
    41       // viewHost
     51      // tabControl
    4252      //
    43       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     53      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    4454                  | System.Windows.Forms.AnchorStyles.Left)
    4555                  | System.Windows.Forms.AnchorStyles.Right)));
    46       this.viewHost.Caption = "View";
    47       this.viewHost.Content = null;
    48       this.viewHost.Location = new System.Drawing.Point(0, 26);
    49       this.viewHost.Name = "viewHost";
    50       this.viewHost.ReadOnly = false;
    51       this.viewHost.Size = new System.Drawing.Size(729, 455);
    52       this.viewHost.TabIndex = 7;
    53       this.viewHost.ViewType = null;
     56      this.tabControl.Controls.Add(this.valueTabPage);
     57      this.tabControl.Controls.Add(this.configurationtabPage);
     58      this.tabControl.Controls.Add(this.childParameterTabPage);
     59      this.tabControl.Location = new System.Drawing.Point(3, 26);
     60      this.tabControl.Name = "tabControl";
     61      this.tabControl.SelectedIndex = 0;
     62      this.tabControl.Size = new System.Drawing.Size(553, 447);
     63      this.tabControl.TabIndex = 5;
     64      //
     65      // valueTabPage
     66      //
     67      this.valueTabPage.Controls.Add(this.valueViewHost);
     68      this.valueTabPage.Location = new System.Drawing.Point(4, 22);
     69      this.valueTabPage.Name = "valueTabPage";
     70      this.valueTabPage.Padding = new System.Windows.Forms.Padding(3);
     71      this.valueTabPage.Size = new System.Drawing.Size(545, 421);
     72      this.valueTabPage.TabIndex = 0;
     73      this.valueTabPage.Text = "Value";
     74      this.valueTabPage.UseVisualStyleBackColor = true;
     75      //
     76      // valueViewHost
     77      //
     78      this.valueViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     79                  | System.Windows.Forms.AnchorStyles.Left)
     80                  | System.Windows.Forms.AnchorStyles.Right)));
     81      this.valueViewHost.Caption = "Value";
     82      this.valueViewHost.Content = null;
     83      this.valueViewHost.Enabled = false;
     84      this.valueViewHost.Location = new System.Drawing.Point(3, 3);
     85      this.valueViewHost.Name = "valueViewHost";
     86      this.valueViewHost.ReadOnly = false;
     87      this.valueViewHost.Size = new System.Drawing.Size(539, 415);
     88      this.valueViewHost.TabIndex = 0;
     89      this.valueViewHost.ViewType = null;
     90      //
     91      // configurationtabPage
     92      //
     93      this.configurationtabPage.Controls.Add(this.configurationViewHost);
     94      this.configurationtabPage.Location = new System.Drawing.Point(4, 22);
     95      this.configurationtabPage.Name = "configurationtabPage";
     96      this.configurationtabPage.Padding = new System.Windows.Forms.Padding(3);
     97      this.configurationtabPage.Size = new System.Drawing.Size(545, 421);
     98      this.configurationtabPage.TabIndex = 1;
     99      this.configurationtabPage.Text = "Configuration";
     100      this.configurationtabPage.UseVisualStyleBackColor = true;
     101      //
     102      // configurationViewHost
     103      //
     104      this.configurationViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     105                  | System.Windows.Forms.AnchorStyles.Left)
     106                  | System.Windows.Forms.AnchorStyles.Right)));
     107      this.configurationViewHost.Caption = "Configuration";
     108      this.configurationViewHost.Content = null;
     109      this.configurationViewHost.Enabled = false;
     110      this.configurationViewHost.Location = new System.Drawing.Point(4, 4);
     111      this.configurationViewHost.Name = "configurationViewHost";
     112      this.configurationViewHost.ReadOnly = false;
     113      this.configurationViewHost.Size = new System.Drawing.Size(538, 414);
     114      this.configurationViewHost.TabIndex = 0;
     115      this.configurationViewHost.ViewType = null;
     116      //
     117      // childParameterTabPage
     118      //
     119      this.childParameterTabPage.Controls.Add(this.childParameterConfigurationListView);
     120      this.childParameterTabPage.Location = new System.Drawing.Point(4, 22);
     121      this.childParameterTabPage.Name = "childParameterTabPage";
     122      this.childParameterTabPage.Size = new System.Drawing.Size(545, 421);
     123      this.childParameterTabPage.TabIndex = 2;
     124      this.childParameterTabPage.Text = "Child Parameters";
     125      this.childParameterTabPage.UseVisualStyleBackColor = true;
     126      //
     127      // childParameterConfigurationListView
     128      //
     129      this.childParameterConfigurationListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     130                  | System.Windows.Forms.AnchorStyles.Left)
     131                  | System.Windows.Forms.AnchorStyles.Right)));
     132      this.childParameterConfigurationListView.Caption = "Parameter Configuration";
     133      this.childParameterConfigurationListView.Content = null;
     134      this.childParameterConfigurationListView.Location = new System.Drawing.Point(4, 4);
     135      this.childParameterConfigurationListView.Name = "childParameterConfigurationListView";
     136      this.childParameterConfigurationListView.ReadOnly = false;
     137      this.childParameterConfigurationListView.Size = new System.Drawing.Size(538, 414);
     138      this.childParameterConfigurationListView.TabIndex = 0;
    54139      //
    55140      // ParameterConfigurationView
     
    57142      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    58143      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    59       this.Controls.Add(this.viewHost);
     144      this.Controls.Add(this.tabControl);
    60145      this.Controls.Add(this.optimizeCheckBox);
    61146      this.Name = "ParameterConfigurationView";
    62       this.Size = new System.Drawing.Size(729, 481);
     147      this.Size = new System.Drawing.Size(556, 473);
     148      this.tabControl.ResumeLayout(false);
     149      this.valueTabPage.ResumeLayout(false);
     150      this.configurationtabPage.ResumeLayout(false);
     151      this.childParameterTabPage.ResumeLayout(false);
    63152      this.ResumeLayout(false);
    64153      this.PerformLayout();
     
    69158
    70159    private System.Windows.Forms.CheckBox optimizeCheckBox;
    71     private MainForm.WindowsForms.ViewHost viewHost;
     160    private System.Windows.Forms.TabControl tabControl;
     161    private System.Windows.Forms.TabPage valueTabPage;
     162    private MainForm.WindowsForms.ViewHost valueViewHost;
     163    private System.Windows.Forms.TabPage configurationtabPage;
     164    private MainForm.WindowsForms.ViewHost configurationViewHost;
     165    private System.Windows.Forms.TabPage childParameterTabPage;
     166    private ParameterConfigurationListView childParameterConfigurationListView;
    72167  }
    73168}
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/ParameterConfigurationView.cs

    r4525 r4830  
    1010using HeuristicLab.Core.Views;
    1111using HeuristicLab.Core;
     12using HeuristicLab.Collections;
    1213
    1314namespace HeuristicLab.Problems.MetaOptimization.Views {
     
    1617  /// </summary>
    1718  [View("ParameterConfiguration View")]
    18   [Content(typeof(IParameterConfiguration), true)]
     19  [Content(typeof(IParameterConfiguration), false)]
     20  [Content(typeof(ParameterConfiguration), true)]
    1921  public partial class ParameterConfigurationView : ItemView {
    2022    /// <summary>
     
    3537      base.OnContentChanged();
    3638      if (Content != null) {
    37         viewHost.Content = Content.Parameter;
     39        optimizeCheckBox.Checked = Content.OptimizationEnabled;
     40        valueViewHost.ViewType = typeof(ValueView);
     41        valueViewHost.Content = Content;
     42        if (Content is IntValueParameterConfiguration) {
     43          configurationViewHost.Content = ((IntValueParameterConfiguration)Content).Ranges;
     44        } else {
     45          configurationViewHost.Content = null;
     46        }
     47
     48        childParameterConfigurationListView.Content = ((ParameterConfiguration)Content).ChildParameterConfigurations;
    3849      } else {
    39         viewHost.Content = null;
     50        valueViewHost.Content = null;
     51        configurationViewHost.Content = null;
     52        childParameterConfigurationListView.Content = null;
    4053      }
     54      SetEnabledStateOfControls();
     55    }
     56
     57    protected override void RegisterContentEvents() {
     58      base.RegisterContentEvents();
     59      Content.ChildParameterConfigurations.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IParameterConfiguration>>(ChildParameterConfigurations_ItemsAdded);
     60      Content.ChildParameterConfigurations.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IParameterConfiguration>>(ChildParameterConfigurations_ItemsRemoved);
     61    }
     62    protected override void DeregisterContentEvents() {
     63      Content.ChildParameterConfigurations.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IParameterConfiguration>>(ChildParameterConfigurations_ItemsAdded);
     64      Content.ChildParameterConfigurations.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IParameterConfiguration>>(ChildParameterConfigurations_ItemsRemoved);
     65      base.DeregisterContentEvents();
     66    }
     67
     68    void ChildParameterConfigurations_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<IParameterConfiguration>> e) {
     69      SetEnabledStateOfControls();
     70    }
     71   
     72    void ChildParameterConfigurations_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<IParameterConfiguration>> e) {
     73      SetEnabledStateOfControls();
    4174    }
    4275
    4376    protected override void SetEnabledStateOfControls() {
    4477      base.SetEnabledStateOfControls();
     78      this.SuspendLayout();
     79      if (optimizeCheckBox.Checked) {
     80        DisableTabPage(valueTabPage);
     81        EnableTabPage(configurationtabPage);
     82        if (Content.ChildParameterConfigurations.Count > 0)
     83          EnableTabPage(childParameterTabPage);
     84      } else {
     85        DisableTabPage(configurationtabPage);
     86        DisableTabPage(childParameterTabPage);
     87        EnableTabPage(valueTabPage);
     88      }
     89      this.ResumeLayout();
    4590    }
    4691
    4792    private void optimizeCheckBox_CheckedChanged(object sender, EventArgs e) {
     93      Content.OptimizationEnabled = optimizeCheckBox.Checked;
     94      SetEnabledStateOfControls();
     95    }
    4896
     97    protected void EnableTabPage(TabPage tabPage) {
     98      if (!tabControl.TabPages.Contains(tabPage)) {
     99        tabControl.TabPages.Add(tabPage);
     100      }
     101    }
     102
     103    protected void DisableTabPage(TabPage tabPage) {
     104      if (tabControl.TabPages.Contains(tabPage)) {
     105        tabControl.TabPages.Remove(tabPage);
     106      }
    49107    }
    50108  }
Note: See TracChangeset for help on using the changeset viewer.