Example #1
0
        private void ListTables_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListColums.UnselectAll();
            textBoxChangedColumn.Text    = "";
            gridChangedColumn.Visibility = Visibility.Hidden;

            if (!ListColums.Items.IsEmpty)
            {
                ListColums.Items.Clear();
            }
            int index = ListTables.SelectedIndex;

            if (index != -1)
            {
                for (int i = 0; i < structure.Tables[index].Columns.Count; i++)
                {
                    ListColums.Items.Add(structure.Tables[index].Columns[i].Name);
                }
            }

            gridChangedTable.Visibility = Visibility.Visible;
            if (ListTables.SelectedIndex != -1)
            {
                textBoxChangedTable.Text = structure.Tables[ListTables.SelectedIndex].Name;
            }
        }
Example #2
0
        private void buttonChangedTable_Click(object sender, RoutedEventArgs e)
        {
            int index_table = ListTables.SelectedIndex;

            structure.Tables[index_table].Rename(textBoxChangedTable.Text, structure.Connection);

            ListTables.UnselectAll();
            ListColums.UnselectAll();
            ListTables.Items.Clear();
            ListColums.Items.Clear();
            structure.FillStructure(structure.Connection);
            for (int i = 0; i < structure.Tables.Count; i++)
            {
                ListTables.Items.Add(structure.Tables[i].Name);
            }
            ListTables.SelectedIndex = index_table;
        }