Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/13/10 02:14:39 (13 years ago)
Author:
abeham
Message:

#1258

  • Updated binding according to discussion
  • Added small test case for the TSP
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ParameterBinding/HeuristicLab.Core/3.3/ParameterizedNamedItem.cs

    r4770 r4787  
    3333  public abstract class ParameterizedNamedItem : NamedItem, IParameterizedNamedItem {
    3434    [Storable]
    35     private List<IParameterBinding> parameterBindingList;
    36     public List<IParameterBinding> ParameterBindingList {
     35    private List<IItemBinding> parameterBindingList;
     36    public List<IItemBinding> ParameterBindingList {
    3737      get { return parameterBindingList; }
    3838    }
     
    6262      name = ItemName;
    6363      description = ItemDescription;
    64       parameterBindingList = new List<IParameterBinding>();
     64      parameterBindingList = new List<IItemBinding>();
    6565      parameters = new ParameterCollection();
    6666      readOnlyParameters = null;
     
    6969      : base(name) {
    7070      description = ItemDescription;
    71       parameterBindingList = new List<IParameterBinding>();
     71      parameterBindingList = new List<IItemBinding>();
    7272      parameters = new ParameterCollection();
    7373      readOnlyParameters = null;
     
    7676      : base(name) {
    7777      description = ItemDescription;
    78       parameterBindingList = new List<IParameterBinding>();
     78      parameterBindingList = new List<IItemBinding>();
    7979      this.parameters = parameters;
    8080      readOnlyParameters = null;
     
    8282    protected ParameterizedNamedItem(string name, string description)
    8383      : base(name, description) {
    84       parameterBindingList = new List<IParameterBinding>();
     84      parameterBindingList = new List<IItemBinding>();
    8585      parameters = new ParameterCollection();
    8686      readOnlyParameters = null;
     
    8888    protected ParameterizedNamedItem(string name, string description, ParameterCollection parameters)
    8989      : base(name, description) {
    90       parameterBindingList = new List<IParameterBinding>();
     90      parameterBindingList = new List<IItemBinding>();
    9191      this.parameters = parameters;
    9292      readOnlyParameters = null;
     
    105105    }
    106106
     107    protected virtual void AddBinding(string targetPath, string sourcePath) {
     108      ItemBinding binding = new ItemBinding(this, targetPath, this, sourcePath);
     109      parameterBindingList.Add(binding);
     110      binding.Bind();
     111    }
     112
     113    protected virtual void AddSourceBinding(IDeepCloneable target, string targetPath, string sourcePath) {
     114      ItemBinding binding = new ItemBinding(target, targetPath, this, sourcePath);
     115      parameterBindingList.Add(binding);
     116      binding.Bind();
     117    }
     118
     119    protected virtual void AddTargetBinding(string targetPath, IDeepCloneable source, string sourcePath) {
     120      ItemBinding binding = new ItemBinding(this, targetPath, source, sourcePath);
     121      parameterBindingList.Add(binding);
     122      binding.Bind();
     123    }
     124
    107125    [StorableHook(HookType.AfterDeserialization)]
    108126    private void AfterDeserialization() {
     
    110128      #region Remove this code when going to 3.4
    111129      if (parameterBindingList == null)
    112         parameterBindingList = new List<IParameterBinding>();
     130        parameterBindingList = new List<IItemBinding>();
    113131      #endregion
    114132    }
Note: See TracChangeset for help on using the changeset viewer.