Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/11 10:16:53 (13 years ago)
Author:
abeham
Message:

#1623

  • Added some range checks in the DataRowVisualPropertiesControl
  • Added a check to prevent axis minimum and maximum equality to avoid a crash
  • Added AfterDeserialization hooks to the visual properties to detect the illegal .Net default configuration
Location:
trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs

    r6628 r6676  
    252252      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    253253    }
     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    }
    254272  }
    255273}
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs

    r6342 r6676  
    491491      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    492492    }
     493
     494    [StorableHook(HookType.AfterDeserialization)]
     495    private void AfterDeserialization() {
     496      // BackwardsCompatibility3.3
     497      #region Backwards compatible code, remove with 3.4
     498      // check if most of the properties that were added in Mai'11 were set to their default values, then we want to reset them to our default values
     499      if (xAxisMinimumAuto == default(bool) && xAxisMaximumAuto == default(bool)
     500        && yAxisMinimumAuto == default(bool) && yAxisMaximumAuto == default(bool)
     501        && secondXAxisMinimumAuto == default(bool) && secondXAxisMaximumAuto == default(bool)
     502        && secondYAxisMinimumAuto == default(bool) && secondYAxisMaximumAuto == default(bool)
     503        && titleColor == default(Color) && axisTitleColor == default(Color)
     504        && secondXAxisTitle == default(string)
     505        && xAxisMinimumFixedValue == default(double) && xAxisMaximumFixedValue == default(double)
     506        && yAxisMinimumFixedValue == default(double) && yAxisMaximumFixedValue == default(double)
     507        && secondXAxisMinimumFixedValue == default(double) && secondXAxisMaximumFixedValue == default(double)
     508        && secondYAxisMinimumFixedValue == default(double) && secondYAxisMaximumFixedValue == default(double)) {
     509        titleColor = Color.Black;
     510        axisTitleColor = Color.Black;
     511        this.secondXAxisTitle = string.Empty;
     512        this.xAxisMinimumAuto = true;
     513        this.xAxisMinimumFixedValue = double.NaN;
     514        this.xAxisMaximumAuto = true;
     515        this.xAxisMaximumFixedValue = double.NaN;
     516        this.secondXAxisMinimumAuto = true;
     517        this.secondXAxisMinimumFixedValue = double.NaN;
     518        this.secondXAxisMaximumAuto = true;
     519        this.secondXAxisMaximumFixedValue = double.NaN;
     520        this.yAxisMinimumAuto = true;
     521        this.yAxisMinimumFixedValue = double.NaN;
     522        this.yAxisMaximumAuto = true;
     523        this.yAxisMaximumFixedValue = double.NaN;
     524        this.secondYAxisMinimumAuto = true;
     525        this.secondYAxisMinimumFixedValue = double.NaN;
     526        this.secondYAxisMaximumAuto = true;
     527        this.secondYAxisMaximumFixedValue = double.NaN;
     528      #endregion
     529      }
     530    }
    493531  }
    494532}
Note: See TracChangeset for help on using the changeset viewer.