Beispiel #1
0
        public WindowTreeViewTest2()
        {
            haPrj = new HerbalAnalysisProject();
            List <TestingSample> nodes = new List <TestingSample>()
            {
                new TestingSample {
                    PicturesPath = new System.IO.DirectoryInfo(@"C:\Users\潘全星\Documents\360截图")
                },
                new TestingSample {
                    PicturesPath = new System.IO.DirectoryInfo(@"D:\matlabTest\1\1")
                },
                new TestingSample {
                    PicturesPath = new System.IO.DirectoryInfo(@"D:\matlabTest\1\2")
                }
            };

            haPrj.TestsSamples = nodes;
            InitializeComponent();
            this.TreeView.ItemsSource = haPrj.TestsSamples;
        }
Beispiel #2
0
        //新建项目命令
        private void NewPqxProjCommand(object sender, ExecutedRoutedEventArgs e)
        {
            ProjInitiWindow piw  = new ProjInitiWindow();
            bool?           isOk = piw.ShowDialog();

            if (isOk == true)
            {
                haProj = piw.HaProj;
                Directory.CreateDirectory(haProj.GetActualProjFolderPath());
                //File.Create(haProj.GetMainProjFilePath()).Close();
                string[] projData         = { DateTime.Now.ToString(), haProj.GetActualProjFolderPath() + "\\".ToString() + haProj.Name + ".xml".ToString() };
                string   mainProjFilePath = haProj.GetMainProjFilePath();
                File.WriteAllLines(mainProjFilePath, projData);
                HistoryProjItemManager.AddHistoryItem(mainProjFilePath);
                isNeedUpdata = true;
                MessageBox.Show("确定" + haProj.ToString());
            }
            else if (isOk == false)
            {
                MessageBox.Show("取消");
            }
        }