Example #1
0
        private void addNewConnection_Click(object sender, RoutedEventArgs e)
        {
            var w    = new AddConnectionWindow();
            var conn = new Connection();

            w.DataContext = conn;
            var res = w.ShowDialog();

            if (res.HasValue && res.Value)
            {
                _connectionConfiguration.Connections.Insert(0, conn);
                DBLint.DBLintGui.ConnectionSerializer.SaveConnectionConfiguration(_connectionConfiguration);
                comboConnections.SelectedItem = conn;
            }
        }
Example #2
0
        private void editConnection_Click(object sender, RoutedEventArgs e)
        {
            var conn = comboConnections.SelectedValue as Connection;

            if (conn == null)
            {
                return;
            }
            var w = new AddConnectionWindow();

            w.DataContext = conn;
            w.ShowDialog();
            comboConnections.SelectedItem = null;
            this._connectionConfiguration.Connections.Remove(conn);
            this._connectionConfiguration.Connections.Insert(0, conn);
            comboConnections.SelectedItem = conn;
            ConnectionSerializer.SaveConnectionConfiguration(this._connectionConfiguration);
        }