Пример #1
0
        private static bool Display(ConnectionViewModel viewModel)
        {
            var window = new ConnectionEditorWindow(viewModel);

            window.Owner   = Application.Current.MainWindow;
            window.Loaded += (sender, args) => viewModel.SetWindowHandle(new WindowInteropHelper(sender as Window).Handle);;
            return(window.ShowDialog() ?? false);
        }
Пример #2
0
        public virtual void EditValue(Property property, object designer)
        {
            DbDesignerBase dbDesigner       = designer as DbDesignerBase;
            ConnectionType connectionType   = dbDesigner.ConnectionType;
            string         connectionString = dbDesigner.ResolvedConnectionString;

            if ((ConnectionEditorWindow.EditConnectionString(ref connectionType, ref connectionString, dbDesigner.SupportedConnectionTypes)) &&
                ((connectionType != dbDesigner.ConnectionType) || (connectionString != dbDesigner.ResolvedConnectionString)))
            {
                dbDesigner.Context.TransactionManager.StartTransaction("Change connection string");
                dbDesigner.ConnectionType   = connectionType;
                dbDesigner.ConnectionString = connectionString;
                dbDesigner.Context.TransactionManager.StopTransaction();
            }
        }