Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/10 15:55:45 (14 years ago)
Author:
gkronber
Message:

Implemented view for symbolic expression grammars and symbols. #1014

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Symbols/Symbol.cs

    r3742 r3824  
    4141      set {
    4242        if (value < 0.0) throw new ArgumentException("InitialFrequency must be positive");
    43         initialFrequency = value;
     43        if (value != initialFrequency) {
     44          initialFrequency = value;
     45          OnChanged(EventArgs.Empty);
     46        }
    4447      }
     48    }
     49    public override bool CanChangeName {
     50      get { return false; }
    4551    }
    4652    #endregion
     
    5864
    5965    public override IDeepCloneable Clone(Cloner cloner) {
    60       Symbol clone = (Symbol) base.Clone(cloner);
     66      Symbol clone = (Symbol)base.Clone(cloner);
    6167      clone.initialFrequency = initialFrequency;
    6268      return clone;
    6369    }
     70
     71    #region events
     72    public event EventHandler Changed;
     73    protected void OnChanged(EventArgs e) {
     74      EventHandler handlers = Changed;
     75      if (handlers != null)
     76        handlers(this, e);
     77    }
     78    #endregion
    6479  }
    6580}
Note: See TracChangeset for help on using the changeset viewer.