private void ButtonForDropDB_Click(object sender, RoutedEventArgs e) { var dialog = new ConfirmationDialog(this, "Be sure to drop the database: " + _openDBName); dialog.ShowDialog(); if (dialog.IsConfirm) { if (!Controller.GetController().DropCurrentDB()) { return; } var db = DBTreeView.FindChild <TreeViewItem>(_openDBName); DBTreeView.Items.Remove(db); OperationForRemoveDBTreeViewItem(); } }
// private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) // { // var dataGridCell = (sender as FrameworkElement).Parent as DataGridCell; // // var dataGridRow = dataGridCell.Parent as DataGridRow; // // if (e.Source.ToString() == "character varying") // { // DataGridForSchema.GetCellContent(dataGridRow.GetIndex(), 2).IsEnabled = true; // } // else // { // DataGridForSchema.GetCellContent(dataGridRow.GetIndex(), 2).IsEnabled = false; // } // } // // private void ButtonForDisablingCheckbox_Click(object sender, RoutedEventArgs e) // { // // The following line can reach the purpose of disabling the control in the cell // // DataGridForSchema.GetCell(0, 3).IsEnabled = false; // // // The following line can not reach that purpose // (DataGridForSchema.GetCell(0, 3).Content as CheckBox).IsEnabled = false; // // } private void ButtonForDropTable_Click(object sender, RoutedEventArgs e) { var dialog = new ConfirmationDialog(this, "Be sure to drop the table: " + _openTableName); dialog.ShowDialog(); if (dialog.IsConfirm) { if (!Controller.GetController().DropCurrentTable()) { return; } var db = DBTreeView.FindChild <TreeViewItem>(_openDBName); var table = DBTreeView.FindChild <TreeViewItem>(_openDBName + "_" + _openTableName); db.Items.Remove(table); GridForAddAndRemoveRow.Visibility = Visibility.Collapsed; ButtonForModifyColumn.IsEnabled = false; ButtonForDeleteTable.IsEnabled = false; DataGridForContent.ItemsSource = null; } }