Ejemplo n.º 1
0
        private void LoadProject_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.InitialDirectory = "d:\\";
            dialog.RestoreDirectory = true;
            dialog.Filter           = "工程文件 (*.db) | *.db";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string   delimStr  = "\\";
                char[]   delimiter = delimStr.ToCharArray();
                string[] sArray;

                ProjectPath_textBox.Text = dialog.FileName;
                projectPath_output       = dialog.FileName;
                projectName          = projectPath_output.Substring(0, projectPath_output.Length - 3);
                sArray               = projectName.Split(delimiter);
                projectName          = sArray[sArray.Length - 1];
                projectFolder_output = sArray[0];
                for (int i = 1; i < sArray.Length - 1; i++)
                {
                    projectFolder_output = projectFolder_output + "\\" + sArray[i];
                }

                this.ExportWord_button.IsEnabled  = true;
                this.ExportExcel_button.IsEnabled = true;
                this.checkBox.IsEnabled           = true;

                databaseFile = new DatabaseFile(projectPath_output);
                databaseFile.ReadDbFile();
            }
        }