Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14580


Ignore:
Timestamp:
01/18/17 11:17:58 (7 years ago)
Author:
mkommend
Message:

#2709: Changed initialization of caches to avoid NullReferenceExceptions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r14514 r14580  
    1616  [Content(typeof(MultiScatterPlotContent), true)]
    1717  public partial class ScatterPlotMultiView : PreprocessingCheckedVariablesView {
    18     private readonly IDictionary<string, Label> columnHeaderCache;
    19     private readonly IDictionary<string, VerticalLabel> rowHeaderCache;
    20     private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, Control> bodyCache;
     18    private readonly IDictionary<string, Label> columnHeaderCache = new Dictionary<string, Label>();
     19    private readonly IDictionary<string, VerticalLabel> rowHeaderCache = new Dictionary<string, VerticalLabel>();
     20    private readonly IDictionary<Tuple<string/*col*/, string/*row*/>, Control> bodyCache = new Dictionary<Tuple<string, string>, Control>();
    2121
    2222    public ScatterPlotMultiView() {
     
    4343      bodyScrollPanel.AutoScroll = true;
    4444      #endregion
    45 
    46       columnHeaderCache = new Dictionary<string, Label>();
    47       rowHeaderCache = new Dictionary<string, VerticalLabel>();
    48       bodyCache = new Dictionary<Tuple<string, string>, Control>();
    4945
    5046      bodyScrollPanel.MouseWheel += bodyScrollPanel_MouseWheel;
     
    113109      tlp.ColumnStyles.Insert(idx, new ColumnStyle(SizeType.Absolute, GetColumnWidth()));
    114110      // shift right
    115       for (int c = tlp.ColumnCount; c >  idx - 1; c--) {
     111      for (int c = tlp.ColumnCount; c > idx - 1; c--) {
    116112        for (int r = 0; r < tlp.RowCount; r++) {
    117113          var control = tlp.GetControlFromPosition(c, r);
     
    233229    #endregion
    234230
    235     #region Creating Headers and Body 
     231    #region Creating Headers and Body
    236232    private Label GetColumnHeader(string variable) {
    237233      if (!columnHeaderCache.ContainsKey(variable)) {
Note: See TracChangeset for help on using the changeset viewer.