Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/04/11 10:04:09 (13 years ago)
Author:
abeham
Message:

#1541, #1603, #1606, #1607

  • merged to trunk
Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableHistoryView.cs

    r6342 r6628  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Core.Views;
     
    3839      using (DataTableVisualPropertiesDialog dialog = new DataTableVisualPropertiesDialog(current)) {
    3940        if (dialog.ShowDialog() != DialogResult.OK) return;
     41        Dictionary<string, bool> changeDisplayName = new Dictionary<string, bool>();
     42        foreach (DataRow row in current.Rows) {
     43          var answer = MessageBox.Show("Change display name for series " + row.Name + " to " + row.VisualProperties.DisplayName + " for all frames?", "Confirm change", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
     44          if (answer == DialogResult.Cancel) return;
     45          changeDisplayName[row.Name] = (answer == DialogResult.Yes);
     46        }
    4047        foreach (DataTable dt in Content) {
    41           if (current != dt) {
    42             dt.VisualProperties = (DataTableVisualProperties)current.VisualProperties.Clone();
    43             foreach (DataRow row in current.Rows)
    44               dt.Rows[row.Name].VisualProperties = (DataRowVisualProperties)row.VisualProperties.Clone();
     48          if (current == dt) continue;
     49          dt.VisualProperties = (DataTableVisualProperties)current.VisualProperties.Clone();
     50          foreach (DataRow row in current.Rows) {
     51            if (!dt.Rows.ContainsKey(row.Name)) continue;
     52            string oldDisplayName = dt.Rows[row.Name].VisualProperties.DisplayName;
     53            var props = (DataRowVisualProperties)row.VisualProperties.Clone();
     54            if (!changeDisplayName[row.Name]) props.DisplayName = oldDisplayName;
     55            dt.Rows[row.Name].VisualProperties = props;
    4556          }
    4657        }
Note: See TracChangeset for help on using the changeset viewer.