Exemplo n.º 1
0
 public void ShowConfiguration()
 {
     if (Content != null)
     {
         using (var dialog = new DataTableVisualPropertiesDialog(Content)) {
             dialog.ShowDialog(this);
         }
     }
     else
     {
         MessageBox.Show("Nothing to configure.");
     }
 }
Exemplo n.º 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;
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
 public void ShowConfiguration() {
   if (Content != null) {
     using (var dialog = new DataTableVisualPropertiesDialog(Content)) {
       dialog.ShowDialog(this);
     }
   } else MessageBox.Show("Nothing to configure.");
 }