Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3628


Ignore:
Timestamp:
05/05/10 12:44:29 (15 years ago)
Author:
gkronber
Message:

Added ReadOnlyCheckedItemCollection and ReadOnlyCheckedItemList #992 (CheckedItemList and CheckedItemCollection is necessary)

Location:
trunk/sources
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs

    r3595 r3628  
    3333namespace HeuristicLab.Core.Views {
    3434  [View("CheckedItemCollection View")]
    35   [Content(typeof(ICheckedItemCollection<>), false)]
     35  [Content(typeof(ICheckedItemCollection<>), true)]
    3636  [Content(typeof(CheckedItemCollection<>), true)]
    3737  public partial class CheckedItemCollectionView<T> : ItemCollectionView<T> where T : class, IItem {
  • trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs

    r3595 r3628  
    3737  [View("CheckedItemList View")]
    3838  [Content(typeof(CheckedItemList<>), true)]
    39   [Content(typeof(ICheckedItemList<>), false)]
     39  [Content(typeof(ICheckedItemList<>), true)]
    4040  public partial class CheckedItemListView<T> : ItemListView<T> where T : class, IItem {
    4141    public new ICheckedItemList<T> Content {
  • trunk/sources/HeuristicLab.Core/3.3/Collections/CheckedItemCollection.cs

    r3594 r3628  
    113113
    114114    /// <summary>
     115    /// Creates a ReadOnlyCheckedItemCollection containing the same elements.
     116    /// </summary>
     117    /// <returns>A new ReadOnlyCheckedItemCollection containing the same elements.</returns>
     118    public new ReadOnlyCheckedItemCollection<T> AsReadOnly() {
     119      return new ReadOnlyCheckedItemCollection<T>(this);
     120    }
     121
     122    /// <summary>
    115123    /// Raised when the collection of items is reset.
    116124    /// </summary>
  • trunk/sources/HeuristicLab.Core/3.3/Collections/CheckedItemList.cs

    r3594 r3628  
    149149
    150150    /// <summary>
     151    /// Creates a ReadOnlyCheckedItemList containing the same elements.
     152    /// </summary>
     153    /// <returns>A new ReadOnlyCheckedItemList containing the same elements.</returns>
     154    public new ReadOnlyCheckedItemList<T> AsReadOnly() {
     155      return new ReadOnlyCheckedItemList<T>(this);
     156    }
     157
     158    /// <summary>
    151159    /// Raised after the list has been reset.
    152160    /// </summary>
  • trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj

    r3602 r3628  
    104104    <Compile Include="Collections\CheckedItemCollection.cs" />
    105105    <Compile Include="Collections\CheckedItemList.cs" />
     106    <Compile Include="Collections\ReadOnlyCheckedItemCollection.cs" />
     107    <Compile Include="Collections\ReadOnlyCheckedItemList.cs">
     108      <SubType>Code</SubType>
     109    </Compile>
    106110    <Compile Include="Collections\ReadOnlyItemDictionary.cs" />
    107111    <Compile Include="Collections\ItemDictionary.cs" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs

    r3599 r3628  
    4646    }
    4747
    48     public IValueParameter<CheckedItemList<StringValue>> InputVariablesParameter {
    49       get { return (IValueParameter<CheckedItemList<StringValue>>)Parameters["InputVariables"]; }
     48    public IValueParameter<ICheckedItemList<StringValue>> InputVariablesParameter {
     49      get { return (IValueParameter<ICheckedItemList<StringValue>>)Parameters["InputVariables"]; }
    5050    }
    5151
     
    8585      }
    8686    }
    87     public CheckedItemList<StringValue> InputVariables {
    88       get { return (CheckedItemList<StringValue>)InputVariablesParameter.Value; }
     87    public ICheckedItemList<StringValue> InputVariables {
     88      get { return (ICheckedItemList<StringValue>)InputVariablesParameter.Value; }
    8989      set {
    9090        if (value != InputVariables) {
     
    140140      : base() {
    141141      Parameters.Add(new ValueParameter<Dataset>("Dataset", new Dataset()));
    142       Parameters.Add(new ValueParameter<CheckedItemList<StringValue>>("InputVariables", new CheckedItemList<StringValue>()));
     142      Parameters.Add(new ValueParameter<ICheckedItemList<StringValue>>("InputVariables", new CheckedItemList<StringValue>()));
    143143      Parameters.Add(new ConstrainedValueParameter<StringValue>("TargetVariable"));
    144144      Parameters.Add(new ValueParameter<IntValue>("TrainingSamplesStart", new IntValue()));
     
    329329        ((ConstrainedValueParameter<StringValue>)TargetVariableParameter).ValidValues.Add(variableName);
    330330      TargetVariable = variableNames.First();
    331       InputVariables = new CheckedItemList<StringValue>(variableNames);
     331      InputVariables = new CheckedItemList<StringValue>(variableNames).AsReadOnly();
    332332      foreach (var variableName in variableNames.Skip(1))
    333333        InputVariables.SetItemCheckedState(variableName, true);
Note: See TracChangeset for help on using the changeset viewer.