コード例 #1
0
        private void Edit_Connection(object sender, RoutedEventArgs e)
        {
            // Clicked connection
            var connection = (Connection)((Button)sender).DataContext;

            // Let user edit it
            var save = new EditConnectionWindow(connection).ShowDialog();

            if (save != true)
            {
                // TODO edit Cancel => Revert changes
            }

            // Update view
            DisplayConnectionInListView();
        }
コード例 #2
0
        private void Add_Connection(object sender, RoutedEventArgs e)
        {
            // Create default connection
            var connection = new Connection();

            // Let user edit it
            var save = new EditConnectionWindow(connection).ShowDialog();

            if (save == true)
            {
                SettingsManager.Instance.CurrentSettings.Connections.Add(connection);
            }

            // Update view
            DisplayConnectionInListView();
        }