Example #1
0
 private void TextBlock_MouseUp(object sender, MouseButtonEventArgs e)
 {
     if (!File.Exists((sender as TextBlock).Text))
     {
         HistoryProjItemManager.RemoveItem((sender as TextBlock).Text);
         isNeedUpdata = true;
     }
 }
Example #2
0
 //加载最近项目菜单
 private void menuItemFile_MouseEnter(object sender, MouseEventArgs e)
 {
     if (isNeedUpdata)
     {
         Queue historyQueue = HistoryProjItemManager.GetHistoryItems();
         menuItemRecentProject.ItemsSource = historyQueue;//采用数据绑定
         isNeedUpdata = false;
     }
 }
Example #3
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("取消");
            }
        }