Exemple #1
0
 public void ShowConfiguration()
 {
     if (Content != null)
     {
         using (var dialog = new DataTableVisualPropertiesDialog(Content)) {
             dialog.ShowDialog(this);
         }
     }
     else
     {
         MessageBox.Show("Nothing to configure.");
     }
 }
Exemple #2
0
        public void ShowConfiguration()
        {
            DataTable current = viewHost.Content as DataTable;

            if (current == null)
            {
                return;
            }
            using (var dialog = new DataTableVisualPropertiesDialog <DataRow>(current)) {
                if (dialog.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                HashSet <string> modifiedDisplayNames = new HashSet <string>(dialog.RowsWithModifiedDisplayNames);
                foreach (DataTable dt in Content)
                {
                    if (current == dt)
                    {
                        continue;
                    }
                    dt.VisualProperties = (DataTableVisualProperties)current.VisualProperties.Clone();
                    foreach (DataRow row in current.Rows)
                    {
                        if (!dt.Rows.ContainsKey(row.Name))
                        {
                            continue;
                        }
                        string oldDisplayName = dt.Rows[row.Name].VisualProperties.DisplayName;
                        dt.Rows[row.Name].VisualProperties = (DataRowVisualProperties)row.VisualProperties.Clone();
                        if (!modifiedDisplayNames.Contains(row.Name))
                        {
                            dt.Rows[row.Name].VisualProperties.DisplayName = oldDisplayName;
                        }
                    }
                }
            }
        }
 public void ShowConfiguration() {
   if (Content != null) {
     using (var dialog = new DataTableVisualPropertiesDialog(Content)) {
       dialog.ShowDialog(this);
     }
   } else MessageBox.Show("Nothing to configure.");
 }