private void EditColumn()
        {
            DataGridColumnModel columnModel = datagridColumnsListBox.SelectedItem as DataGridColumnModel;

            if (columnModel == null)
            {
                return;
            }

            using (ModelEditingScope scope = columnModel.Column.BeginEdit(columnModel.Column.Name + " Changed"))
            {
                EditDataGridColumnsUserInterface ui = new EditDataGridColumnsUserInterface(_context, columnModel, _dataSourceProperties);

                // Use Windows Forms to show the design time because Windows Forms knows about the VS message pump
                System.Windows.Forms.DialogResult result = DesignerDialog.ShowDesignerDialog("Edit Column", ui, 360, 470);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    scope.Complete();
                    _dataSourcePropertiesCVS.View.Refresh();
                }
                else
                {
                    scope.Revert();
                }
            }
        }
Esempio n. 2
0
 public static DialogResult ShowDesignerDialog(string title, Wpf.UIElement wpfContent, int width, int height)
 {
     DesignerDialog dlg = new DesignerDialog(title, wpfContent);
     dlg.Width = width;
     dlg.Height = height;
     dlg.SizeGripStyle = SizeGripStyle.Hide;
     return dlg.ShowDialog();
 }
Esempio n. 3
0
        public static DialogResult ShowDesignerDialog(string title, Wpf.UIElement wpfContent, int width, int height)
        {
            DesignerDialog dlg = new DesignerDialog(title, wpfContent);

            dlg.Width         = width;
            dlg.Height        = height;
            dlg.SizeGripStyle = SizeGripStyle.Hide;
            return(dlg.ShowDialog());
        }
        /// <summary>
        ///     Add and configure Columns
        /// </summary>
        private void AddColumnsMenuAction_Execute(object sender, MenuActionEventArgs e)
        {
            using (ModelEditingScope scope = e.Selection.PrimarySelection.BeginEdit("Columns Changed"))
            {
                AddDataGridColumnsUserInterface ui = new AddDataGridColumnsUserInterface(e.Context, e.Selection.PrimarySelection);

                // Use Windows Forms to show the design time because Windows Forms knows about the VS message pump
                System.Windows.Forms.DialogResult result = DesignerDialog.ShowDesignerDialog("Add/Edit Columns", ui);
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    scope.Complete();
                }
                else
                {
                    scope.Revert();
                }
            }
        }