Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/11/14 10:40:01 (10 years ago)
Author:
rstoll
Message:
  • Refactorings for DataGridContent and FitlerContent
Location:
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridContent.cs

    r10900 r10964  
    3535    private readonly IFilterLogic filterLogic;
    3636
    37     public DataGridContent(IDataGridLogic theDataGridLogic, IManipulationLogic theManipulationLogic, IFilterLogic theFilterLogic) {
    38       dataGridLogic = theDataGridLogic;
    39       manipulationLogic = theManipulationLogic;
    40       filterLogic = theFilterLogic;
    41     }
    42 
    43     public DataGridContent(DataGridContent dataGridContent, Cloner cloner)
    44       : base(dataGridContent, cloner) {
    45     }
    46 
    4737    public IManipulationLogic ManipulationLogic {
    4838      get { return manipulationLogic; }
     
    6353    public static new Image StaticItemImage {
    6454      get { return HeuristicLab.Common.Resources.VSImageLibrary.Table; }
    65     }
    66 
    67     public override IDeepCloneable Clone(Cloner cloner) {
    68       return new DataGridContent(this, cloner);
    6955    }
    7056
     
    118104    }
    119105
    120     public bool Validate(string value, out string errorMessage) {
    121       errorMessage = string.Empty;
    122       return true;
     106    public DataGridContent(IDataGridLogic theDataGridLogic, IManipulationLogic theManipulationLogic, IFilterLogic theFilterLogic) {
     107      dataGridLogic = theDataGridLogic;
     108      manipulationLogic = theManipulationLogic;
     109      filterLogic = theFilterLogic;
     110    }
     111
     112    public DataGridContent(DataGridContent dataGridContent, Cloner cloner)
     113      : base(dataGridContent, cloner) {
     114
     115    }
     116
     117    public override IDeepCloneable Clone(Cloner cloner) {
     118      return new DataGridContent(this, cloner);
    123119    }
    124120
     
    129125    public bool SetValue(string value, int rowIndex, int columnIndex) {
    130126      return dataGridLogic.SetValue(value, columnIndex, rowIndex);
     127    }
     128
     129    public event DataPreprocessingChangedEventHandler Changed {
     130      add { dataGridLogic.Changed += value; }
     131      remove { dataGridLogic.Changed -= value; }
     132    }
     133
     134
     135
     136    #region unused stuff/not implemented but necessary due to IStringConvertibleMatrix
     137
     138    // Is not used since DataGridContentView overrides dataGridView_CellValidating and uses
     139    // DataGridLogic#Validate(string value, out string errorMessage, int columnIndex)
     140    public bool Validate(string value, out string errorMessage) {
     141      errorMessage = string.Empty;
     142      return true;
    131143    }
    132144
     
    144156
    145157    public event EventHandler Reset;
     158    #endregion
    146159
    147     public event DataPreprocessingChangedEventHandler Changed {
    148       add { dataGridLogic.Changed += value; }
    149       remove { dataGridLogic.Changed -= value; }
    150     }
    151160  }
    152161}
  • branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/FilterContent.cs

    r10877 r10964  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using System.Collections.Generic;
    2625using HeuristicLab.DataPreprocessing.Filter;
    2726
     
    4039    public bool isAndCombination = true;
    4140
    42     public FilterContent(IFilterLogic theFilterLogic) {
    43       filterLogic = theFilterLogic;
    44     }
    4541
    4642    public IFilterLogic FilterLogic {
     
    5046    }
    5147
    52     public ICheckedItemCollection<IFilter> Filters
    53     {
    54       get
    55       {
     48    public ICheckedItemCollection<IFilter> Filters {
     49      get {
    5650        return this.filters;
    5751      }
    58       set
    59       {
     52      set {
    6053        this.filters = value;
    6154      }
    6255    }
    6356
    64     public bool IsAndCombination
    65     {
    66       get
    67       {
     57    public bool IsAndCombination {
     58      get {
    6859        return this.isAndCombination;
    6960      }
    70       set
    71       {
     61      set {
    7262        this.isAndCombination = value;
    7363      }
    7464    }
    7565
    76     public FilterContent(FilterContent content, Cloner cloner)
     66    public FilterContent(IFilterLogic theFilterLogic) {
     67      filterLogic = theFilterLogic;
     68    }
     69
     70    protected FilterContent(FilterContent content, Cloner cloner)
    7771      : base(content, cloner) {
    78 
    7972    }
    8073
     
    8275      return new FilterContent(this, cloner);
    8376    }
    84 
    85 
    86 
    8777  }
    8878}
Note: See TracChangeset for help on using the changeset viewer.