Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/14/17 19:21:44 (7 years ago)
Author:
gkronber
Message:

#2669: merged r14289 and r14290 from trunk to stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs

    r14186 r14571  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Common;
     
    3435  public abstract class SymbolicClassificationModel : SymbolicDataAnalysisModel, ISymbolicClassificationModel {
    3536    [Storable]
    36     private readonly string targetVariable;
     37    private string targetVariable;
    3738    public string TargetVariable {
    3839      get { return targetVariable; }
     40      set {
     41        if (string.IsNullOrEmpty(value) || targetVariable == value) return;
     42        targetVariable = value;
     43        OnTargetVariableChanged(this, EventArgs.Empty);
     44      }
    3945    }
    4046
    4147    [StorableConstructor]
    42     protected SymbolicClassificationModel(bool deserializing) : base(deserializing) { }
     48    protected SymbolicClassificationModel(bool deserializing)
     49      : base(deserializing) {
     50      targetVariable = string.Empty;
     51    }
    4352
    4453    protected SymbolicClassificationModel(SymbolicClassificationModel original, Cloner cloner)
     
    6473      Scale(problemData, problemData.TargetVariable);
    6574    }
     75
     76    #region events
     77    public event EventHandler TargetVariableChanged;
     78    private void OnTargetVariableChanged(object sender, EventArgs args) {
     79      var changed = TargetVariableChanged;
     80      if (changed != null)
     81        changed(sender, args);
     82    }
     83    #endregion
    6684  }
    6785}
Note: See TracChangeset for help on using the changeset viewer.