| 
					
				 | 
			
			
				@@ -1,88 +1,87 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using GeekDesk.Control.Windows; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using GeekDesk.Util; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using GeekDesk.Util; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using GeekDesk.ViewModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using HandyControl.Controls; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using Microsoft.Win32; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Collections.Generic; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Linq; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Text; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Threading.Tasks; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Windows; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Windows.Controls; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Windows.Data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Windows.Documents; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Windows.Input; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Windows.Media; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Windows.Media.Imaging; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Windows.Navigation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Windows.Shapes; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-namespace GeekDesk.Control.UserControls.Backlog 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public enum ToDoType 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        HISTORY = 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        NEW = 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+namespace GeekDesk.Control.Other 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    /// BacklogControl.xaml 的交互逻辑 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /// TextDialog.xaml 的交互逻辑 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public partial class TodoControl : UserControl 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public partial class IconInfoDialog 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public ToDoType type; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        public TodoControl() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public HandyControl.Controls.Dialog dialog; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public IconInfoDialog() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             InitializeComponent(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void DeleteMenu_Click(object sender, RoutedEventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public IconInfoDialog(IconInfo info) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ToDoInfo info = BacklogList.SelectedItem as ToDoInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Growl.Ask("确认删除吗?", isConfirmed => 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (isConfirmed) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    if (type == ToDoType.NEW) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        MainWindow.appData.ToDoList.Remove(info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        MainWindow.appData.HiToDoList.Remove(info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    CommonCode.SaveAppData(MainWindow.appData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }, "DeleteConfirm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            this.DataContext = info; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            InitializeComponent(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void DetailMenu_Click(object sender, RoutedEventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// 保存修改属性 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <param name="sender"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// <param name="e"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void SaveProperty(object sender, RoutedEventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ToDoInfo info = BacklogList.SelectedItem as ToDoInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ToDoInfoWindow.ShowDetail(info); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IconInfo info = this.DataContext as IconInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            info.BitmapImage = IconImg.Source as BitmapImage; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            info.Name = IconName.Text; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            info.AdminStartUp = IconIsAdmin.IsChecked.Value; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            info.StartArg = StartArg.Text; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            CommonCode.SaveAppData(MainWindow.appData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            dialog.Close(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// 禁用设置按钮右键菜单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// 修改图标为默认 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <param name="sender"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <param name="e"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void DataGridMenu_Initialized(object sender, EventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void ReStoreImage(object sender, RoutedEventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BacklogList.ContextMenu = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            IconInfo info = this.DataContext as IconInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            info.BitmapImage = ImageUtil.ByteArrToImage(info.DefaultImage); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            CommonCode.SaveAppData(MainWindow.appData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        /// 打开右键菜单 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /// 修改图标 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// </summary> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <param name="sender"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <param name="e"></param> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void DataGridRow_MouseRightButtonDown(object sender, MouseButtonEventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void EditImage(object sender, RoutedEventArgs e) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BacklogList.SelectedIndex = ((DataGridRow)sender).GetIndex(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Menu.IsOpen = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            try 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                OpenFileDialog ofd = new OpenFileDialog 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Multiselect = false, //只允许选中单个文件 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Filter = "所有文件(*.*)|*.*" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (ofd.ShowDialog() == true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    IconInfo info = this.DataContext as IconInfo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    info.BitmapImage = ImageUtil.GetBitmapIconByPath(ofd.FileName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    CommonCode.SaveAppData(MainWindow.appData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            catch (Exception e1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                HandyControl.Controls.Growl.WarningGlobal("修改图标失败,已重置为默认图标!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                LogUtil.WriteErrorLog(e1, "修改图标失败!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |