Exemplo n.º 1
0
 /// <summary>
 /// 判断快捷方式所指的文件(目录或驱动器)是否存在
 /// </summary>
 private void UpdateItems()
 {
     try
     {
         foreach (var info in Dal.GetData())
         {
             if (info.ItemType == 1 && !File.Exists(info.ItemPath))
             {
                 info.ItemPath.Del();
                 info.ItemPage.UpdateIndex(info.ItemIndex);
             }
             else if ((info.ItemType == 2 || info.ItemType == 3) && !Directory.Exists(info.ItemPath))
             {
                 info.ItemPath.Del();
                 info.ItemPage.UpdateIndex(info.ItemIndex);
             }
         }
     }
     catch (Exception ee)
     {
         MyWork.NoteLog(ee);
     }
 }
Exemplo n.º 2
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         if (closeFlag == "")
         {
             this.Deactivated -= new EventHandler(Window_Deactivated);
             this.WindowState  = WindowState.Normal;
             if (MessageBox.Show("退出EasyStarter吗?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
             {
                 Application.Current.Shutdown();
             }
             else
             {
                 e.Cancel          = true;
                 this.Deactivated += new EventHandler(Window_Deactivated);
             }
         }
     }
     catch (Exception ee)
     {
         MyWork.NoteLog(ee);
     }
 }
Exemplo n.º 3
0
 void moveleft_Tick(object sender, EventArgs e)//向后翻页
 {
     try
     {
         if (((PanelControl)this.maingrid.Children[CurrentPage]).Margin.Left - 6 >= 0)
         {
             for (int i = 0; i < this.maingrid.Children.Count; i++)
             {
                 double tempMargin = ((PanelControl)this.maingrid.Children[i]).Margin.Left;
                 ((PanelControl)this.maingrid.Children[i]).Margin = new Thickness(tempMargin - 6, 0, 0, 0);
             }
         }
         else
         {
             moveleft.IsEnabled = false;
             CurrentPage       += 1;
             UpdatePageControlChecked(CurrentPage);
         }
     }
     catch (Exception ee)
     {
         MyWork.NoteLog(ee);
     }
 }