Beispiel #1
0
        private void databaseListBox_Item_Click(object sender, RoutedEventArgs e)
        {
            String connecting_string = DatabaseStackPanal.selected_database_connecting_string(ServerListbox, databaseListbox);

            connectingsStringLabel.Content = connecting_string;

            return;
        }
Beispiel #2
0
        private void serverListBox_Item_Click(object sender, RoutedEventArgs e)
        {
            databaseListbox.Items.Clear();
            String selectedServerdisplayName = ServerListbox.SelectedItems[0].ToString();
            int    ServerId = ServerHandle.find_dispaly_name_index(selectedServerdisplayName);

            DatabaseStackPanal.initializeDatabaseString(ServerId, databaseListbox);

            String file_path = ServerHandle.selected_server_file_path(ServerListbox);

            severfilePathLabel.Content     = file_path;
            connectingsStringLabel.Content = "";
            return;
        }
        public static void deleteServer(ListBox listbox)
        {
            if (listbox.SelectedItems.Count > 0)
            {
                int indexSettingFile = find_dispaly_name_index(listbox.SelectedItems[0].ToString());
                Properties.Settings.Default["configServer" + indexSettingFile.ToString()] = "-1";
                Properties.Settings.Default.Save();

                listbox.Items.Remove(listbox.SelectedItems[0]);

                String dbHalf_Property = "configServer" + indexSettingFile.ToString() + "DB";
                DatabaseStackPanal.reset_all_database_ofServer(dbHalf_Property);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Nothing is Selected");
            }
        }
Beispiel #4
0
        private void okaybtn_Click(object sender, RoutedEventArgs e)
        {
            String folderPath = projectFolder_label.Content.ToString();

            if (folderPath != null)
            {
                String ReplaceIt = replaceTextbox.Text;
                String ReplaceBy = DatabaseStackPanal.selected_database_connecting_string(ServerListbox, databaseListbox);
                //replace_word_in_file(CurrentWorkingFile, ReplaceIt, ReplaceBy);
                List <string> file_list = find_all_xml_config_file_inDIR(projectFolder_label.Content.ToString());
                replace_string_in_all_file(file_list, ReplaceIt, ReplaceBy);
                MessageBox.Show("successfully Replace");
            }
            else
            {
                MessageBox.Show("Please First Select The Project Folder");
            }

            return;

            /*
             * String CurrentWorkingFile = Properties.Settings.Default.activeFileName;
             * if (!CurrentWorkingFile.Equals("-1"))
             * {
             *  String ReplaceIt = replaceTextbox.Text;
             *  String ReplaceBy = DatabaseStackPanal.selected_database_connecting_string(ServerListbox, databaseListbox);
             *  replace_word_in_file(CurrentWorkingFile, ReplaceIt, ReplaceBy);
             *
             *  MessageBox.Show("successfully Replace");
             * }
             * else
             * {
             *  MessageBox.Show("Sorry, No Active File Found. Please Open File ");
             * }
             * return;
             */
        }
Beispiel #5
0
 private void database_delete_btn_Click(object sender, RoutedEventArgs e)
 {
     DatabaseStackPanal.delete_database_Name(databaseListbox, ServerListbox);
     return;
 }
Beispiel #6
0
 private void add_database_toSettingsbtn_Click(object sender, RoutedEventArgs e)
 {
     DatabaseStackPanal.Add_database_Name(databaseListbox, ServerListbox, server_file_textbox.Text, serverDispalyNameText.Text);
     return;    //serverDispalyNameText.Text, server_file_textbox.Text
 }