Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/14/11 13:59:25 (13 years ago)
Author:
epitzer
Message:

#1530 integrate changes from trunk

Location:
branches/PersistenceSpeedUp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceSpeedUp

  • branches/PersistenceSpeedUp/HeuristicLab.Analysis

  • branches/PersistenceSpeedUp/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs

    r5445 r6760  
    2020#endregion
    2121
     22using System;
    2223using System.ComponentModel;
    2324using System.Drawing;
     
    3637      Columns,
    3738      Points,
    38       Bars
     39      Bars,
     40      Histogram
     41    }
     42    #endregion
     43    #region LineStyle
     44    public enum DataRowLineStyle {
     45      Dash,
     46      DashDot,
     47      DashDotDot,
     48      Dot,
     49      NotSet,
     50      Solid
    3951    }
    4052    #endregion
     
    6072      }
    6173    }
     74    private bool secondXAxis;
     75    public bool SecondXAxis {
     76      get { return secondXAxis; }
     77      set {
     78        if (secondXAxis != value) {
     79          secondXAxis = value;
     80          OnPropertyChanged("SecondXAxis");
     81        }
     82      }
     83    }
    6284    private Color color;
    6385    public Color Color {
     
    7092      }
    7193    }
     94    private DataRowLineStyle lineStyle;
     95    public DataRowLineStyle LineStyle {
     96      get { return lineStyle; }
     97      set {
     98        if (lineStyle != value) {
     99          lineStyle = value;
     100          OnPropertyChanged("LineStyle");
     101        }
     102      }
     103    }
    72104    private bool startIndexZero;
    73105    public bool StartIndexZero {
     
    77109          startIndexZero = value;
    78110          OnPropertyChanged("StartIndexZero");
     111        }
     112      }
     113    }
     114    private int lineWidth;
     115    public int LineWidth {
     116      get { return lineWidth; }
     117      set {
     118        if (lineWidth != value) {
     119          lineWidth = value;
     120          OnPropertyChanged("LineWidth");
     121        }
     122      }
     123    }
     124    private int bins;
     125    public int Bins {
     126      get { return bins; }
     127      set {
     128        if (bins != value) {
     129          bins = value;
     130          OnPropertyChanged("Bins");
     131        }
     132      }
     133    }
     134    private bool exactBins;
     135    public bool ExactBins {
     136      get { return exactBins; }
     137      set {
     138        if (exactBins != value) {
     139          exactBins = value;
     140          OnPropertyChanged("ExactBins");
     141        }
     142      }
     143    }
     144    private string displayName;
     145    public string DisplayName {
     146      get { return displayName == null ? String.Empty : displayName; }
     147      set {
     148        if (displayName != value) {
     149          if (value == null && displayName != String.Empty) {
     150            displayName = String.Empty;
     151            OnPropertyChanged("DisplayName");
     152          } else if (value != null) {
     153            displayName = value;
     154            OnPropertyChanged("DisplayName");
     155          }
    79156        }
    80157      }
     
    92169      set { secondYAxis = value; }
    93170    }
     171    [Storable(Name = "SecondXAxis")]
     172    private bool StorableSecondXAxis {
     173      get { return secondXAxis; }
     174      set { secondXAxis = value; }
     175    }
    94176    [Storable(Name = "Color")]
    95177    private Color StorableColor {
     
    97179      set { color = value; }
    98180    }
     181    [Storable(Name = "LineStyle")]
     182    private DataRowLineStyle StorableLineStyle {
     183      get { return lineStyle; }
     184      set { lineStyle = value; }
     185    }
    99186    [Storable(Name = "StartIndexZero")]
    100187    private bool StorableStartIndexZero {
    101188      get { return startIndexZero; }
    102189      set { startIndexZero = value; }
     190    }
     191    [Storable(Name = "LineWidth")]
     192    private int StorableLineWidth {
     193      get { return lineWidth; }
     194      set { lineWidth = value; }
     195    }
     196    [Storable(Name = "Bins")]
     197    private int StorableBins {
     198      get { return bins; }
     199      set { bins = value; }
     200    }
     201    [Storable(Name = "ExactBins")]
     202    private bool StorableExactBins {
     203      get { return exactBins; }
     204      set { exactBins = value; }
     205    }
     206    [Storable(Name = "DisplayName")]
     207    private string StorableDisplayName {
     208      get { return displayName; }
     209      set { displayName = value; }
    103210    }
    104211    #endregion
     
    110217      this.chartType = original.chartType;
    111218      this.secondYAxis = original.secondYAxis;
     219      this.secondXAxis = original.secondXAxis;
    112220      this.color = original.color;
     221      this.lineStyle = original.lineStyle;
    113222      this.startIndexZero = original.startIndexZero;
     223      this.lineWidth = original.lineWidth;
     224      this.bins = original.bins;
     225      this.exactBins = original.exactBins;
     226      this.displayName = original.displayName;
    114227    }
    115228    public DataRowVisualProperties() {
    116229      chartType = DataRowChartType.Line;
    117230      secondYAxis = false;
     231      secondXAxis = false;
    118232      color = Color.Empty;
     233      lineStyle = DataRowLineStyle.Solid;
    119234      startIndexZero = false;
     235      lineWidth = 1;
     236      bins = 10;
     237      exactBins = false;
     238      displayName = String.Empty;
     239    }
     240    public DataRowVisualProperties(string displayName)
     241      : this() {
     242      this.displayName = displayName;
    120243    }
    121244
     
    129252      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    130253    }
     254
     255    [StorableHook(HookType.AfterDeserialization)]
     256    private void AfterDeserialization() {
     257      // BackwardsCompatibility3.3
     258      #region Backwards compatible code, remove with 3.4
     259      if (secondXAxis == default(bool)
     260        && lineStyle == default(DataRowLineStyle)
     261        && lineWidth == default(int) && bins == default(int) && exactBins == default(bool)
     262        && displayName == default(string)) {
     263        secondXAxis = false;
     264        lineStyle = DataRowLineStyle.Solid;
     265        lineWidth = 1;
     266        bins = 10;
     267        exactBins = false;
     268        displayName = String.Empty;
     269      }
     270      #endregion
     271    }
    131272  }
    132273}
Note: See TracChangeset for help on using the changeset viewer.