diff --git a/Constant/RunTimeStatus.cs b/Constant/RunTimeStatus.cs index 521d42c..91792bd 100644 --- a/Constant/RunTimeStatus.cs +++ b/Constant/RunTimeStatus.cs @@ -77,6 +77,6 @@ /// /// 控制主界面热键按下规定时间内只执行一次show hide /// - public static volatile int MAIN_HOT_KEY_TIME = 500; + public static volatile int MAIN_HOT_KEY_TIME = 300; } } diff --git a/Control/Other/SearchResControl.xaml b/Control/Other/SearchResControl.xaml index b4af5f9..659930f 100644 --- a/Control/Other/SearchResControl.xaml +++ b/Control/Other/SearchResControl.xaml @@ -95,18 +95,16 @@ - + diff --git a/Control/Other/SearchResControl.xaml.cs b/Control/Other/SearchResControl.xaml.cs index 9d8ffea..14c32a4 100644 --- a/Control/Other/SearchResControl.xaml.cs +++ b/Control/Other/SearchResControl.xaml.cs @@ -1,4 +1,5 @@ using GeekDesk.Constant; +using GeekDesk.Control.Windows; using GeekDesk.Plugins.EveryThing; using GeekDesk.Util; using GeekDesk.ViewModel; @@ -278,5 +279,54 @@ namespace GeekDesk.Control.Other } } + + + + + + + /// + /// 管理员方式启动 + /// + /// + /// + private void IconAdminStart(object sender, RoutedEventArgs e) + { + IconInfo icon = (IconInfo)((MenuItem)sender).Tag; + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); + } + + /// + /// 打开文件所在位置 + /// + /// + /// + private void ShowInExplore(object sender, RoutedEventArgs e) + { + IconInfo icon = (IconInfo)((MenuItem)sender).Tag; + ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE); + } + + + private void SystemContextMenu(object sender, RoutedEventArgs e) + { + IconInfo icon = (IconInfo)((MenuItem)sender).Tag; + DirectoryInfo[] folders = new DirectoryInfo[1]; + folders[0] = new DirectoryInfo(icon.Path); + ShellContextMenu scm = new ShellContextMenu(); + System.Drawing.Point p = System.Windows.Forms.Cursor.Position; + p.X -= 80; + p.Y -= 80; + scm.ShowContextMenu(folders, p); + } + + + + + + + + + } } diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index d349664..1a1033a 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -133,7 +133,10 @@ namespace GeekDesk RunTimeStatus.EVERYTHING_NEW_SEARCH = true; //显示搜索结果列表 RightCard.VisibilitySearchCard(Visibility.Visible); + //暂时隐藏条目信息 SearchResContainer.Visibility = Visibility.Collapsed; + //显示加载条 + RightCard.Loading_RightCard.Visibility = Visibility.Visible; object obj = RightCard.VerticalCard.Content; if (obj != null) { @@ -144,6 +147,8 @@ namespace GeekDesk } } else { + //隐藏条目信息 + SearchResContainer.Visibility = Visibility.Collapsed; //清空查询结果 object obj = RightCard.VerticalCard.Content; if (obj != null) @@ -210,109 +215,13 @@ namespace GeekDesk } SearchResControl control = new SearchResControl(resList); RightCard.VerticalCard.Content = control; - //显示加载效果 + //关闭加载效果 RightCard.Loading_RightCard.Visibility = Visibility.Collapsed; }); }).Start(); - - - - - ////异步加载图标 - //if (iconBakList != null && iconBakList.Count > 0) - //{ - // new Thread(() => - // { - - // }).Start(); - //} - }); - - //EveryThing全盘搜索 - - - - - - - - - //this.Dispatcher.Invoke(() => - //{ - // if (SearchIconList.IconList.Count > 0) - // { - // SearchIconList.RemoveAll(); - // } - - // string inputText = SearchBox.Text.ToLower().Trim(); - - // int count = 0; - // //GeekDesk数据搜索 - // ObservableCollection menuList = appData.MenuList; - // foreach (MenuInfo menu in menuList) - // { - // ObservableCollection iconList = menu.IconList; - // foreach (IconInfo icon in iconList) - // { - // if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; - // string pyName = Pinyin.GetInitials(icon.Name).ToLower(); - // if (icon.Name.Contains(inputText) || pyName.Contains(inputText)) - // { - // SearchIconList.IconList.Add(icon); - // count++; - // } - // } - // } - - - // if (appData.AppConfig.EnableEveryThing == true) - // { - // new Thread(() => - // { - // //EveryThing全盘搜索 - // ObservableCollection iconBakList = EveryThingUtil.Search(inputText); - // count += iconBakList.Count; - // this.Dispatcher.Invoke(() => - // { - // TotalMsgBtn.Visibility = Visibility.Visible; - // TotalMsgBtn.Content = count + " of " + Convert.ToInt64(EveryThingUtil.Everything_GetNumResults()); - // foreach (IconInfo icon in iconBakList) - // { - // if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; - // SearchIconList.IconList.Add(icon); - // } - // }); - - // //异步加载图标 - // if (iconBakList != null && iconBakList.Count > 0) - // { - // new Thread(() => - // { - // foreach (IconInfo icon in iconBakList) - // { - // if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; - // this.Dispatcher.Invoke(() => - // { - // icon.BitmapImage_NoWrite = ImageUtil.GetBitmapIconByUnknownPath(icon.Path); - // }, DispatcherPriority.SystemIdle); - // } - // }).Start(); - // } - // }).Start(); - // } - - - - // //if (RightCard.SearchListBox.Items.Count > 0) - // //{ - // // RightCard.SearchListBox.SelectedIndex = 0; - // //} - // //RightCard.VerticalUFG.Visibility = Visibility.Visible; - //}); - }).Start(); } diff --git a/Plugins/EveryThing/EveryThing32.cs b/Plugins/EveryThing/EveryThing32.cs index 091472d..179122c 100644 --- a/Plugins/EveryThing/EveryThing32.cs +++ b/Plugins/EveryThing/EveryThing32.cs @@ -43,7 +43,7 @@ namespace GeekDesk.Plugins.EveryThing public static extern UInt32 Everything_GetLastError(); [DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")] - public static extern bool Everything_QueryW(bool bWait); + public static extern bool Everything_Query(bool bWait); [DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")] public static extern void Everything_SortResultsByPath(); diff --git a/Plugins/EveryThing/EveryThing64.cs b/Plugins/EveryThing/EveryThing64.cs index 67f582b..35fbaec 100644 --- a/Plugins/EveryThing/EveryThing64.cs +++ b/Plugins/EveryThing/EveryThing64.cs @@ -43,7 +43,7 @@ namespace GeekDesk.Plugins.EveryThing public static extern UInt32 Everything_GetLastError(); [DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")] - public static extern bool Everything_QueryW(bool bWait); + public static extern bool Everything_Query(bool bWait); [DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")] public static extern void Everything_SortResultsByPath(); diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index b729f91..d64995e 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -184,8 +184,11 @@ namespace GeekDesk.Plugins.EveryThing | EveryThingConst.EVERYTHING_REQUEST_PATH | EveryThingConst.EVERYTHING_REQUEST_DATE_MODIFIED | EveryThingConst.EVERYTHING_REQUEST_SIZE); - EveryThingUtil.Everything_SetSort(13); - EveryThingUtil.Everything_QueryW(true); + EveryThingUtil.Everything_SetSort( + EveryThingConst.EVERYTHING_SORT_DATE_MODIFIED_DESCENDING + | EveryThingConst.EVERYTHING_SORT_TYPE_NAME_DESCENDING + | EveryThingConst.EVERYTHING_SORT_RUN_COUNT_DESCENDING); + EveryThingUtil.Everything_Query(true); return NextPage(); } @@ -227,9 +230,8 @@ namespace GeekDesk.Plugins.EveryThing } } - string name = System.IO.Path.GetFileNameWithoutExtension(tempPath); - if (String.IsNullOrEmpty(name)) + if (string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(tempPath)) { name = tempPath.Substring(tempPath.LastIndexOf("\\")); } @@ -289,15 +291,15 @@ namespace GeekDesk.Plugins.EveryThing } } - public static bool Everything_QueryW(bool bWait) + public static bool Everything_Query(bool bWait) { if (Environment.Is64BitOperatingSystem) { - return EveryThing64.Everything_QueryW(bWait); + return EveryThing64.Everything_Query(bWait); } else { - return EveryThing32.Everything_QueryW(bWait); + return EveryThing32.Everything_Query(bWait); } }