Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/15/10 09:41:51 (13 years ago)
Author:
abeham
Message:

#1258

  • Added detection if a certain link in the chain implements INotifyPropertyChanged (still missing -> fire only on a change to the "right" property)
  • Added optional parameter LambdaExpression in the binding
  • Changed cloning behavior of binding -> bindings have to be cloned only after the clone is fully constructed
File:
1 edited

Legend:

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

    r4787 r4790  
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using System.Linq.Expressions;
    2627
    2728namespace HeuristicLab.Core {
     
    3334  public abstract class ParameterizedNamedItem : NamedItem, IParameterizedNamedItem {
    3435    [Storable]
    35     private List<IItemBinding> parameterBindingList;
     36    protected List<IItemBinding> parameterBindingList;
    3637    public List<IItemBinding> ParameterBindingList {
    3738      get { return parameterBindingList; }
     
    5556      : base(original, cloner) {
    5657      parameters = cloner.Clone(original.parameters);
    57       parameterBindingList = original.parameterBindingList.Select(x => cloner.Clone(x)).ToList();
    5858      readOnlyParameters = null;
    5959    }
     
    111111    }
    112112
     113    protected virtual void AddBinding(string targetPath, string sourcePath, LambdaExpression func) {
     114      ItemBinding binding = new ItemBinding(this, targetPath, this, sourcePath, func);
     115      parameterBindingList.Add(binding);
     116      binding.Bind();
     117    }
     118
    113119    protected virtual void AddSourceBinding(IDeepCloneable target, string targetPath, string sourcePath) {
    114120      ItemBinding binding = new ItemBinding(target, targetPath, this, sourcePath);
Note: See TracChangeset for help on using the changeset viewer.