Example #1
0
        private void btnNewConnection_Click(object sender, RoutedEventArgs e)
        {
            ConnectionWizardWindow connectionWizardWindow = new ConnectionWizardWindow();

            connectionWizardWindow.Owner = WizardWindow;
            connectionWizardWindow.ShowDialog();

            if (connectionWizardWindow.DialogResult.HasValue && connectionWizardWindow.DialogResult.Value)
            {
                EDMWizardWindow edmWizardWindow = WizardWindow as EDMWizardWindow;
                edmWizardWindow.Databases.Add(connectionWizardWindow.SelectedDatabase);
                edmWizardWindow.SelectedDatabase = connectionWizardWindow.SelectedDatabase;
            }
        }
        public override void Run()
        {
            ConnectionWizardWindow connectionWizardWindow = new ConnectionWizardWindow();

            connectionWizardWindow.Owner = SD.Workbench.MainWindow;

            connectionWizardWindow.AddAction = new Action(delegate()
            {
                if (connectionWizardWindow.SelectedDatabase.LoadDatabase())
                {
                    DatabasesTreeViewPad.Instance.Databases.Add(connectionWizardWindow.SelectedDatabase);
                    connectionWizardWindow.Close();
                }
            });

            connectionWizardWindow.ShowDialog();
        }
Example #3
0
        private void mnuAddDatabase_Click(object sender, RoutedEventArgs e)
        {
            ConnectionWizardWindow connectionWizardWindow = new ConnectionWizardWindow();

            connectionWizardWindow.Owner = Application.Current.MainWindow;
            connectionWizardWindow.ShowDialog();

            if (connectionWizardWindow.DialogResult.Value)
            {
                connectionWizardWindow.SelectedDatabase.LoadDatabase();

                if (Databases.FirstOrDefault(database => database.ConnectionString == connectionWizardWindow.SelectedDatabase.ConnectionString) == null)
                {
                    Databases.Add(connectionWizardWindow.SelectedDatabase);
                }
            }
        }