From 80a997514025d4f195dd1a20ee96a06f6c2d82a5 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Mon, 20 Mar 2023 14:19:56 +0800 Subject: [PATCH 01/44] =?UTF-8?q?:arrow=5Fup:=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/Config/OtherControl.xaml | 22 ++++++++++++------- Control/UserControls/Config/ThemeControl.xaml | 4 +++- .../PannelCard/RightCardControl.xaml | 3 +-- GeekDesk.csproj | 4 ++-- Util/CommonCode.cs | 6 +++++ packages.config | 2 +- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Control/UserControls/Config/OtherControl.xaml b/Control/UserControls/Config/OtherControl.xaml index 4ddb204..6de912c 100644 --- a/Control/UserControls/Config/OtherControl.xaml +++ b/Control/UserControls/Config/OtherControl.xaml @@ -29,11 +29,13 @@ - + @@ -47,7 +49,9 @@ hc:Poptip.HitMode="None" hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" hc:Poptip.Content="仅Win11有效" - hc:Poptip.Placement="TopLeft"> + hc:Poptip.Placement="LeftTop" + hc:Poptip.VerticalOffset="-35" + hc:Poptip.HorizontalOffset="-1"> @@ -112,8 +116,10 @@ + /// 搜索开始 @@ -124,109 +128,114 @@ namespace GeekDesk RightCard.VerticalUFG.Visibility = Visibility.Collapsed; if (!string.IsNullOrEmpty(inputText)) { - searchDelayHelper.DelayExecute(inputText); - } - else + RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME = 300; + if (!RunTimeStatus.EVERYTHING_NEW_SEARCH) + { + RunTimeStatus.EVERYTHING_NEW_SEARCH = true; + SearchDelay(null, null); + } + } else { - SearchIconList.IconList.Clear(); + new Thread(() => + { + this.Dispatcher.Invoke(() => + { + SearchIconList.RemoveAll(); + }); + }).Start(); } } private void SearchDelay(object sender, EventArgs args) { - this.Dispatcher.Invoke(() => + + new Thread(() => { - SearchIconList.IconList.Clear(); - DelayHelper dh = sender as DelayHelper; - string inpuText = dh.Source as string; - - //GeekDesk数据搜索 - ObservableCollection menuList = appData.MenuList; - foreach (MenuInfo menu in menuList) + while (RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME > 0) { - ObservableCollection iconList = menu.IconList; - foreach (IconInfo icon in iconList) - { - string pyName = Pinyin.GetInitials(icon.Name).ToLower(); - if (icon.Name.Contains(inpuText) || pyName.Contains(inpuText)) - { - SearchIconList.IconList.Add(icon); - } - } + Thread.Sleep(10); + RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME -= 10; } + RunTimeStatus.EVERYTHING_NEW_SEARCH = false; - new Thread(() => + this.Dispatcher.Invoke(() => { - //EveryThing全盘搜索 - - - EveryThing64.Everything_SetSearchW(inpuText); - EveryThing64.Everything_SetRequestFlags( - EveryThingConst.EVERYTHING_REQUEST_FILE_NAME - | EveryThingConst.EVERYTHING_REQUEST_PATH - | EveryThingConst.EVERYTHING_REQUEST_DATE_MODIFIED - | EveryThingConst.EVERYTHING_REQUEST_SIZE); - EveryThing64.Everything_SetSort(13); - - EveryThing64.Everything_QueryW(true); - - UInt32 ui = 0; - string filePath; - const int bufsize = 260; - StringBuilder buf = new StringBuilder(bufsize); - for (int i = 0; ui < EveryThing64.Everything_GetNumResults() && i < 10; i++, ui++) + if (SearchIconList.IconList.Count > 0) { - buf.Clear(); - EveryThing64.Everything_GetResultFullPathName(ui, buf, bufsize); - filePath = buf.ToString(); + SearchIconList.RemoveAll(); + } + //DelayHelper dh = sender as DelayHelper; + //string inpuText = dh.Source as string; + string inputText = SearchBox.Text.ToLower().Trim(); - string tempPath = filePath; - - //string base64 = ImageUtil.FileImageToBase64(path, System.Drawing.Imaging.ImageFormat.Png); - string ext = ""; - if (!ImageUtil.IsSystemItem(filePath)) + int count = 0; + //GeekDesk数据搜索 + ObservableCollection menuList = appData.MenuList; + foreach (MenuInfo menu in menuList) + { + ObservableCollection iconList = menu.IconList; + foreach (IconInfo icon in iconList) { - ext = System.IO.Path.GetExtension(filePath).ToLower(); - } - - string iconPath = null; - if (".lnk".Equals(ext)) - { - - string targetPath = FileUtil.GetTargetPathByLnk(filePath); - iconPath = FileUtil.GetIconPathByLnk(filePath); - if (targetPath != null) + if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; + string pyName = Pinyin.GetInitials(icon.Name).ToLower(); + if (icon.Name.Contains(inputText) || pyName.Contains(inputText)) { - filePath = targetPath; + SearchIconList.IconList.Add(icon); + count++; } } - - IconInfo iconInfo = new IconInfo - { - Path_NoWrite = filePath, - LnkPath_NoWrite = tempPath, - BitmapImage_NoWrite = null, - StartArg_NoWrite = FileUtil.GetArgByLnk(tempPath), - Name_NoWrite = System.IO.Path.GetFileNameWithoutExtension(tempPath), - }; - //IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(filePath); - this.Dispatcher.Invoke(() => - { - SearchIconList.IconList.Add(iconInfo); - }); } - }).Start(); - if (RightCard.SearchListBox.Items.Count > 0) - { - RightCard.SearchListBox.SelectedIndex = 0; - } - RightCard.VerticalUFG.Visibility = Visibility.Visible; - }); + 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); + }); + } + }).Start(); + } + }).Start(); + } + + + + if (RightCard.SearchListBox.Items.Count > 0) + { + RightCard.SearchListBox.SelectedIndex = 0; + } + RightCard.VerticalUFG.Visibility = Visibility.Visible; + }); + + }).Start(); } /// @@ -234,15 +243,34 @@ namespace GeekDesk /// public void HidedSearchBox() { + RunTimeStatus.EVERYTHING_NEW_SEARCH = true; + new Thread(() => + { + Thread.Sleep(1000); + RunTimeStatus.EVERYTHING_NEW_SEARCH = false; + }).Start(); + + Keyboard.Focus(SearchBox); RunTimeStatus.SEARCH_BOX_SHOW = false; SearchBox.TextChanged -= SearchBox_TextChanged; SearchBox.Clear(); SearchBox.TextChanged += SearchBox_TextChanged; SearchBox.Width = 0; - SearchIconList.IconList.Clear(); + TotalMsgBtn.Content = "0 of 0"; + TotalMsgBtn.Visibility = Visibility.Hidden; RightCard.VisibilitySearchCard(Visibility.Collapsed); - Keyboard.Focus(SearchBox); - App.DoEvents(); + + SearchIconList.RemoveAll(); + + //App.DoEvents(); + //new Thread(() => + //{ + // this.Dispatcher.Invoke(() => + // { + + // }); + //}).Start(); + } @@ -329,9 +357,15 @@ namespace GeekDesk //开启延迟搜索 优化搜索功能 searchDelayHelper.Idled += SearchDelay; - //开启EveryThing插件 - EveryThingUtil.StartEveryThing(Constants.PLUGINS_PATH); + if (appData.AppConfig.EnableEveryThing == true) + { + //开启EveryThing插件 + EveryThingUtil.EnableEveryThing(); + } + + + Keyboard.Focus(SearchBox); MessageUtil.ChangeWindowMessageFilter(MessageUtil.WM_COPYDATA, 1); } @@ -784,6 +818,10 @@ namespace GeekDesk { MouseHookThread.Dispose(); } + if (appData.AppConfig.EnableEveryThing == true) + { + EveryThingUtil.DisableEveryThing(); + } Application.Current.Shutdown(); } /// diff --git a/Plugins/EveryThing/32/Everything.ini b/Plugins/EveryThing/32/Everything.ini deleted file mode 100644 index b06380d..0000000 --- a/Plugins/EveryThing/32/Everything.ini +++ /dev/null @@ -1,740 +0,0 @@ -; Please make sure Everything is not running before modifying this file. -[Everything] -run_as_admin=0 -allow_http_server=1 -allow_etp_server=1 -window_x=617 -window_y=182 -window_wide=794 -window_high=664 -maximized=0 -minimized=0 -fullscreen=0 -ontop=0 -bring_into_view=1 -alpha=255 -match_whole_word=0 -match_path=0 -match_case=0 -match_diacritics=0 -match_regex=0 -view=0 -thumbnail_size=64 -thumbnail_fill=0 -min_thumbnail_size=32 -max_thumbnail_size=256 -medium_thumbnail_size=64 -large_thumbnail_size=128 -extra_large_thumbnail_size=256 -thumbnail_load_size=0 -thumbnail_overlay_icon=1 -shell_max_path=0 -allow_multiple_windows=0 -allow_multiple_instances=0 -run_in_background=1 -show_in_taskbar=0 -show_tray_icon=0 -minimize_to_tray=0 -toggle_window_from_tray_icon=0 -alternate_row_color=0 -show_mouseover=0 -check_for_updates_on_startup=0 -beta_updates=0 -show_highlighted_search_terms=1 -text_size=0 -hide_empty_search_results=0 -clear_selection_on_search=1 -show_focus_on_search=0 -new_window_key=0 -show_window_key=0 -toggle_window_key=0 -language=0 -show_selected_item_in_statusbar=1 -statusbar_selected_item_format= -show_size_in_statusbar=0 -statusbar_size_format=0 -open_folder_command2= -open_file_command2= -open_path_command2= -explore_command2= -explore_path_command2= -window_title_format= -taskbar_notification_title_format= -instance_name=GeekDesk_EveryThing -translucent_selection_rectangle_alpha=70 -min_zoom=-6 -max_zoom=27 -context_menu_type=0 -context_menu_shell_extensions=1 -auto_include_fixed_volumes=1 -auto_include_removable_volumes=0 -auto_remove_offline_ntfs_volumes=1 -auto_remove_moved_ntfs_volumes=1 -auto_include_fixed_refs_volumes=1 -auto_include_removable_refs_volumes=0 -auto_remove_offline_refs_volumes=1 -auto_remove_moved_refs_volumes=1 -find_mount_points_on_removable_volumes=0 -scan_volume_drive_letters=1 -last_export_type=0 -max_threads=0 -reuse_threads=1 -find_subfolders_and_files_max_threads=0 -single_parent_context_menu=0 -auto_size_1=512 -auto_size_2=640 -auto_size_3=768 -auto_size_aspect_ratio_x=9 -auto_size_aspect_ratio_y=7 -auto_size_width_only=0 -auto_size_path_x=1 -auto_size_path_y=2 -sticky_vscroll_bottom=1 -last_options_page=2 -draw_focus_rect=1 -date_format= -time_format= -listview_item_high=0 -single_click_open=0 -underline_icon_titles=0 -icons_only=0 -icon_shell_extensions=1 -auto_scroll_repeat_delay=250 -auto_scroll_repeat_rate=50 -open_many_files_warning_threshold=16 -set_foreground_window_attach_thread_input=0 -debug=0 -debug_log=0 -verbose=0 -lvm=1 -ipc=1 -home_match_case=1 -home_match_whole_word=0 -home_match_path=0 -home_match_diacritics=0 -home_regex=0 -home_search=1 -home_filter=0 -home_sort=0 -home_view=0 -home_index=1 -allow_multiple_windows_from_tray=0 -single_click_tray=0 -close_on_execute=0 -double_click_path=0 -update_display_after_scroll=0 -update_display_after_mask=1 -auto_scroll_view=0 -double_quote_copy_as_path=0 -snap=0 -snaplen=10 -rename_select_filepart_only=1 -rename_move_caret_to_selection_end=0 -rename_nav=0 -search_edit_move_caret_to_selection_end=0 -search_edit_drag_accept_files=0 -select_search_on_mouse_click=1 -focus_search_on_activate=0 -reset_vscroll_on_search=1 -wrap_focus=0 -load_icon_priority=0 -load_thumbnail_priority=0 -load_fileinfo_priority=0 -always_request_all_fileinfo=0 -header_high=0 -hide_on_close=0 -max_hidden_windows=0 -winmm=0 -menu_escape_amp=1 -menu_folders=0 -menu_folder_separator= -menu_items_per_column=0 -new_inherit=1 -full_row_select=0 -tray_show_command_line= -dpi=96 -ctrl_mouse_wheel_action=1 -lvm_scroll=1 -allow_open=1 -allow_context_menu=1 -allow_delete=1 -allow_rename=1 -allow_cut=1 -allow_copy=1 -allow_paste=1 -allow_drag_drop=1 -allow_window_message_filter_dragdrop=0 -auto_column_widths=0 -hotkey_explorer_path_search=0 -hotkey_user_notification_state=0 -get_key_name_text=1 -paste_new_line_op=0 -esc_cancel_action=1 -fast_ascii_search=1 -match_path_when_search_contains_path_separator=1 -allow_literal_operators=0 -allow_round_bracket_parenthesis=0 -expand_environment_variables=0 -search_as_you_type=1 -always_update_query_on_search_parameter_change=0 -convert_forward_slash_to_backslash=0 -match_whole_filename_when_using_wildcards=1 -operator_precedence=0 -replace_exact_trailing_star_dot_star_with_star=1 -allow_exclamation_point_not=1 -search_command_prefix= -auto_complete_search_command=1 -double_buffer=1 -search= -show_number_of_results_with_selection=0 -date_descending_first=1 -size_descending_first=1 -size_format=2 -alpha_select=0 -tooltips=1 -listview_tooltips=1 -show_detailed_listview_tooltips=1 -rtl_listview_edit=0 -force_path_ltr_order=1 -force_path_left_align=1 -date_time_order=0 -date_time_align=1 -size_align=3 -invert_layout=0 -update_layout_on_input_language_change=0 -control_shift_action=3 -change_search_rtl_reading_action=3 -invert_layout_action=3 -bookmark_remember_case=1 -bookmark_remember_wholeword=1 -bookmark_remember_path=1 -bookmark_remember_diacritic=1 -bookmark_remember_regex=1 -bookmark_remember_sort=1 -bookmark_remember_view=1 -bookmark_remember_filter=1 -bookmark_remember_index=1 -bookmark_remember_search=1 -bookmark_organize_x=0 -bookmark_organize_y=0 -bookmark_organize_wide=0 -bookmark_organize_high=0 -exclude_list_enabled=1 -exclude_hidden_files_and_folders=0 -exclude_system_files_and_folders=0 -include_only_files= -exclude_files= -db_location= -db_multi_user_filename=0 -db_compress=0 -index_size=1 -fast_size_sort=1 -index_date_created=0 -fast_date_created_sort=0 -index_date_modified=1 -fast_date_modified_sort=1 -index_date_accessed=0 -fast_date_accessed_sort=0 -index_attributes=0 -fast_attributes_sort=0 -index_folder_size=0 -fast_path_sort=1 -fast_extension_sort=0 -extended_information_cache_monitor=1 -db_update_thread_priority=-15 -index_recent_changes=1 -refs_file_id_extd_directory_info_buffer_size=0 -folder_update_thread_mode_background=0 -folder_update_rescan_asap=1 -monitor_thread_mode_background=1 -monitor_retry_delay=30000 -monitor_update_delay=1000 -monitor_pause=0 -usn_record_filter=0xffffffff -cancel_delay=0x000003e8 -allow_ntfs_open_file_by_id=1 -always_update_folder_recent_change=0 -editor_x=0 -editor_y=0 -editor_wide=0 -editor_high=0 -editor_maximized=0 -file_list_relative_paths=0 -rename_x=0 -rename_y=0 -rename_wide=0 -rename_high=0 -rename_match_case=0 -rename_regex=0 -advanced_copy_to_x=0 -advanced_copy_to_y=0 -advanced_copy_to_wide=0 -advanced_copy_to_high=0 -advanced_copy_to_match_case=0 -advanced_copy_to_regex=0 -advanced_move_to_x=0 -advanced_move_to_y=0 -advanced_move_to_wide=0 -advanced_move_to_high=0 -advanced_move_to_match_case=0 -advanced_move_to_regex=0 -advanced_search_x=0 -advanced_search_y=0 -advanced_search_wide=0 -advanced_search_high=0 -advanced_search_page_y_offset=0 -advanced_search_focus_id=0 -advanced_search_warnings=1 -max_recv_size=8388608 -display_full_path_name=0 -size_tiny=10240 -size_small=102400 -size_medium=1048576 -size_large=16777216 -size_huge=134217728 -themed_toolbar=1 -show_copy_name=2 -show_copy_path=2 -show_copy_full_name=2 -show_open_path=2 -show_explore=2 -show_explore_path=2 -copy_path_folder_append_backslash=0 -custom_verb01= -custom_verb02= -custom_verb03= -custom_verb04= -custom_verb05= -custom_verb06= -custom_verb07= -custom_verb08= -custom_verb09= -custom_verb10= -custom_verb11= -custom_verb12= -filters_visible=0 -filters_wide=128 -filters_right_align=1 -filters_tab_stop=0 -filter= -filter_everything_name= -filter_organize_x=0 -filter_organize_y=0 -filter_organize_wide=0 -filter_organize_high=0 -preview_visible=0 -preview_x=640 -preview_tab_stop=0 -preview_mag_filter=0 -preview_min_filter=0 -preview_fill=0 -show_preview_handlers_in_preview_pane=0 -preview_load_size=0 -preview_context=0x00000000 -preview_release_handler_on_clear=0 -sort=Run Count -sort_ascending=0 -always_keep_sort=0 -index=0 -index_file_list= -index_etp_server= -index_link_type=1 -status_bar_visible=1 -select_search_on_focus_mode=1 -select_search_on_set_mode=2 -search_history_enabled=0 -run_history_enabled=0 -search_history_days_to_keep=90 -run_history_days_to_keep=90 -search_history_keep_forever=1 -run_history_keep_forever=1 -search_history_always_suggest=0 -search_history_always_suggest_extend_toolbar=0 -search_history_visible_count_max=12 -search_history_always_suggest_visible_count_max=1 -search_history_show_all_max=256 -search_history_suggestion_max=256 -search_history_show_all_sort=2 -search_history_suggestion_sort=1 -search_history_show_above=0 -search_history_sort=2 -search_history_sort_ascending=0 -search_history_x=0 -search_history_y=0 -search_history_wide=0 -search_history_high=0 -search_history_column_search_wide=208 -search_history_column_search_order=0 -search_history_column_count_wide=128 -search_history_column_count_order=1 -search_history_column_date_wide=128 -search_history_column_date_order=2 -etp_server_enabled=0 -etp_server_bindings= -etp_server_port=21 -etp_server_username= -etp_server_password= -etp_server_welcome_message= -etp_server_log_file_name= -etp_server_logging_enabled=0 -etp_server_log_max_size=4194304 -etp_server_log_delta_size=524288 -etp_server_allow_file_download=1 -ftp_allow_port=1 -ftp_check_data_connection_ip=1 -http_server_enabled=0 -http_server_bindings= -http_title_format= -http_server_port=80 -http_server_username= -http_server_password= -http_server_home= -http_server_default_page= -http_server_log_file_name= -http_server_logging_enabled=0 -http_server_log_max_size=4194304 -http_server_log_delta_size=524288 -http_server_allow_file_download=1 -http_server_items_per_page=32 -http_server_show_drive_labels=0 -http_server_strings= -http_server_header= -service_pipe_name= -name_column_pos=0 -name_column_width=256 -path_column_visible=1 -path_column_pos=1 -path_column_width=256 -size_column_visible=1 -size_column_pos=2 -size_column_width=96 -extension_column_visible=0 -extension_column_pos=3 -extension_column_width=96 -type_column_visible=0 -type_column_pos=4 -type_column_width=96 -last_write_time_column_visible=1 -last_write_time_column_pos=3 -last_write_time_column_width=153 -creation_time_column_visible=0 -creation_time_column_pos=6 -creation_time_column_width=153 -date_accessed_column_visible=0 -date_accessed_column_pos=7 -date_accessed_column_width=153 -attribute_column_visible=0 -attribute_column_pos=8 -attribute_column_width=70 -date_recently_changed_column_visible=0 -date_recently_changed_column_pos=9 -date_recently_changed_column_width=153 -run_count_column_visible=0 -run_count_column_pos=10 -run_count_column_width=96 -date_run_column_visible=0 -date_run_column_pos=11 -date_run_column_width=153 -file_list_filename_column_visible=0 -file_list_filename_column_pos=12 -file_list_filename_column_width=96 -translucent_selection_rectangle_background_color= -translucent_selection_rectangle_border_color= -thumbnail_mouseover_border_color= -preview_background_color= -ntfs_volume_guids="\\\\?\\Volume{6afe1915-0a0b-4e59-96bc-666ff914ea4f}","\\\\?\\Volume{71be44cf-e03a-462f-a9c8-b53c16e002a4}" -ntfs_volume_paths="C:","D:" -ntfs_volume_roots="","" -ntfs_volume_includes=1,1 -ntfs_volume_load_recent_changes=0,0 -ntfs_volume_include_onlys="","" -ntfs_volume_monitors=1,1 -refs_volume_guids= -refs_volume_paths= -refs_volume_roots= -refs_volume_includes= -refs_volume_load_recent_changes= -refs_volume_include_onlys= -refs_volume_monitors= -filelists= -filelist_monitor_changes= -folders= -folder_monitor_changes= -folder_buffer_size_list= -folder_rescan_if_full_list= -folder_update_types= -folder_update_days= -folder_update_ats= -folder_update_intervals= -folder_update_interval_types= -exclude_folders= -connect_history_hosts= -connect_history_ports= -connect_history_usernames= -connect_history_link_types= -etp_client_rewrite_patterns= -etp_client_rewrite_substitutions= -file_new_search_window_keys=334 -file_open_file_list_keys=335 -file_close_file_list_keys= -file_close_keys=343,27 -file_export_keys=339 -file_copy_full_name_to_clipboard_keys=9539 -file_copy_path_to_clipboard_keys= -file_set_run_count_keys= -file_create_shortcut_keys= -file_delete_keys=8238 -file_delete_permanently_keys=9262 -file_edit_keys= -file_open_keys=8205 -file_open_selection_and_close_everything_keys= -file_explore_path_keys= -file_open_new_keys= -file_open_path_keys=8461 -file_open_with_keys= -file_open_with_default_verb_keys= -file_play_keys= -file_preview_keys= -file_print_keys= -file_print_to_keys= -file_properties_keys=8717 -file_read_extended_information_keys=8517 -file_rename_keys=8305 -file_run_as_keys= -file_exit_keys=337 -file_copy_name_to_clipboard_keys= -file_open_selection_and_do_not_close_everything_keys= -file_open_most_run_keys= -file_open_last_run_keys= -file_custom_verb_1_keys= -file_custom_verb_2_keys= -file_custom_verb_3_keys= -file_custom_verb_4_keys= -file_custom_verb_5_keys= -file_custom_verb_6_keys= -file_custom_verb_7_keys= -file_custom_verb_8_keys= -file_custom_verb_9_keys= -file_custom_verb_10_keys= -file_custom_verb_11_keys= -file_custom_verb_12_keys= -indexes_folders_rescan_all_now_keys= -indexes_force_rebuild_keys= -edit_cut_keys=8536 -edit_copy_keys=8515,8493 -edit_paste_keys=8534,9261 -edit_select_all_keys=8513 -edit_invert_selection_keys= -edit_copy_to_folder_keys= -edit_move_to_folder_keys= -edit_advanced_advanced_copy_to_folder_keys= -edit_advanced_advanced_move_to_folder_keys= -view_filters_keys= -view_preview_keys=592 -view_status_bar_keys= -view_details_keys=1334 -view_medium_thumbnails_keys=1331 -view_large_thumbnails_keys=1330 -view_extra_large_thumbnails_keys=1329 -view_increase_thumbnail_size_keys=1467 -view_decrease_thumbnail_size_keys=1469 -view_window_size_small_keys=561 -view_window_size_medium_keys=562 -view_window_size_large_keys=563 -view_window_size_auto_fit_keys=564 -view_zoom_zoom_in_keys=443 -view_zoom_zoom_out_keys=445 -view_zoom_reset_keys=304,352 -view_go_to_back_keys=549,166 -view_go_to_forward_keys=551,167 -view_go_to_home_keys=548 -view_go_to_show_all_history_keys=1352,328 -view_sort_by_name_keys=305 -view_sort_by_path_keys=306 -view_sort_by_size_keys=307 -view_sort_by_extension_keys=308 -view_sort_by_type_keys=309 -view_sort_by_date_modified_keys=310 -view_sort_by_date_created_keys=311 -view_sort_by_attributes_keys=312 -view_sort_by_file_list_filename_keys= -view_sort_by_run_count_keys= -view_sort_by_date_run_keys= -view_sort_by_date_recently_changed_keys=313 -view_sort_by_date_accessed_keys= -view_sort_by_ascending_keys= -view_sort_by_descending_keys= -view_refresh_keys=116 -view_fullscreen_keys=122 -view_toggle_ltrrtl_direction_keys= -view_on_top_never_keys= -view_on_top_always_keys= -view_on_top_while_searching_keys= -search_match_case_keys=329 -search_match_whole_word_keys=322 -search_match_path_keys=341 -search_match_diacritics_keys=333 -search_enable_regex_keys=338 -search_advanced_search_keys= -search_add_to_filters_keys= -search_organize_filters_keys=1350 -bookmarks_add_to_bookmarks_keys=324 -bookmarks_organize_bookmarks_keys=1346 -tools_options_keys=336 -tools_console_keys=448 -tools_file_list_editor_keys= -tools_connect_to_etp_server_keys= -tools_disconnect_from_etp_server_keys= -help_everything_help_keys=112 -help_search_syntax_keys= -help_regex_syntax_keys= -help_command_line_options_keys= -help_everything_website_keys= -help_check_for_updates_keys= -help_about_everything_keys=368 -help_donate_keys= -search_edit_focus_search_edit_keys=326,114,580 -search_edit_delete_previous_word_keys=4360 -search_edit_auto_complete_search_keys=4384 -search_edit_show_search_history_keys= -search_edit_show_all_search_history_keys=4646,4648 -result_list_item_up_keys=8230,4134 -result_list_item_down_keys=8232,4136 -result_list_page_up_keys=8225,4129 -result_list_page_down_keys=8226,4130 -result_list_start_of_list_keys=8228 -result_list_end_of_list_keys=8227 -result_list_item_up_extend_keys=9254,5158 -result_list_item_down_extend_keys=9256,5160 -result_list_page_up_extend_keys=9249,5153 -result_list_page_down_extend_keys=9250,5154 -result_list_start_of_list_extend_keys=9252 -result_list_end_of_list_extend_keys=9251 -result_list_focus_up_keys=8486,4390 -result_list_focus_down_keys=8488,4392 -result_list_focus_page_up_keys=8481,4385 -result_list_focus_page_down_keys=8482,4386 -result_list_focus_start_of_list_keys=8484 -result_list_focus_end_of_list_keys=8483 -result_list_focus_up_extend_keys=9510,5414 -result_list_focus_down_extend_keys=9512,5416 -result_list_focus_page_up_extend_keys=9505,5409 -result_list_focus_page_down_extend_keys=9506,5410 -result_list_focus_start_of_list_extend_keys=9508 -result_list_focus_end_of_list_extend_keys=9507 -result_list_focus_result_list_keys= -result_list_focus_highest_run_count_result_keys= -result_list_focus_last_run_result_keys= -result_list_toggle_path_column_keys= -result_list_toggle_size_column_keys= -result_list_toggle_extension_column_keys= -result_list_toggle_type_column_keys= -result_list_toggle_date_modified_column_keys= -result_list_toggle_date_created_column_keys= -result_list_toggle_attributes_column_keys= -result_list_toggle_file_list_filename_column_keys= -result_list_toggle_run_count_column_keys= -result_list_toggle_date_recently_changed_column_keys= -result_list_toggle_date_accessed_column_keys= -result_list_toggle_date_run_column_keys= -result_list_size_all_columns_to_fit_keys=8555 -result_list_size_result_list_to_fit_keys= -result_list_context_menu_keys=9337 -result_list_scroll_left_or_thumbnail_left_keys=8229 -result_list_scroll_right_or_thumbnail_right_keys=8231 -result_list_scroll_page_left_or_thumbnail_focus_left_keys=8485 -result_list_scroll_page_right_or_thumbnail_focus_right_keys=8487 -result_list_left_extend_keys=9253 -result_list_right_extend_keys=9255 -result_list_focus_left_extend_keys=9509 -result_list_focus_right_extend_keys=9511 -result_list_select_focus_keys=8224 -result_list_toggle_focus_selection_keys=8480 -result_list_copy_as_csv_keys= -preview_focus_preview_keys= -result_list_font= -result_list_font_size= -search_edit_font= -search_edit_font_size= -status_bar_font= -status_bar_font_size= -header_font= -header_font_size= -normal_background_color= -normal_foreground_color= -normal_bold= -highlighted_background_color= -highlighted_foreground_color= -highlighted_bold= -current_sort_background_color= -current_sort_foreground_color= -current_sort_bold= -current_sort_highlighted_background_color= -current_sort_highlighted_foreground_color= -current_sort_highlighted_bold= -selected_background_color= -selected_foreground_color= -selected_bold= -selected_highlighted_background_color= -selected_highlighted_foreground_color= -selected_highlighted_bold= -selected_inactive_background_color= -selected_inactive_foreground_color= -selected_inactive_bold= -selected_inactive_highlighted_background_color= -selected_inactive_highlighted_foreground_color= -selected_inactive_highlighted_bold= -drop_target_background_color= -drop_target_foreground_color= -drop_target_bold= -drop_target_highlighted_background_color= -drop_target_highlighted_foreground_color= -drop_target_highlighted_bold= -mouseover_background_color= -mouseover_foreground_color= -mouseover_bold= -mouseover_highlighted_background_color= -mouseover_highlighted_foreground_color= -mouseover_highlighted_bold= -mouseover_current_sort_background_color= -mouseover_current_sort_foreground_color= -mouseover_current_sort_bold= -mouseover_current_sort_highlighted_background_color= -mouseover_current_sort_highlighted_foreground_color= -mouseover_current_sort_highlighted_bold= -alternate_row_background_color= -alternate_row_foreground_color= -alternate_row_bold= -alternate_row_highlighted_background_color= -alternate_row_highlighted_foreground_color= -alternate_row_highlighted_bold= -current_sort_alternate_row_background_color= -current_sort_alternate_row_foreground_color= -current_sort_alternate_row_bold= -current_sort_alternate_row_highlighted_background_color= -current_sort_alternate_row_highlighted_foreground_color= -current_sort_alternate_row_highlighted_bold= -hot_background_color= -hot_foreground_color= -hot_bold= -hot_highlighted_background_color= -hot_highlighted_foreground_color= -hot_highlighted_bold= -selected_hot_background_color= -selected_hot_foreground_color= -selected_hot_bold= -selected_hot_highlighted_background_color= -selected_hot_highlighted_foreground_color= -selected_hot_highlighted_bold= -selected_inactive_hot_background_color= -selected_inactive_hot_foreground_color= -selected_inactive_hot_bold= -selected_inactive_hot_highlighted_background_color= -selected_inactive_hot_highlighted_foreground_color= -selected_inactive_hot_highlighted_bold= -thumbnail_mouseover_background_color= -thumbnail_mouseover_foreground_color= -thumbnail_mouseover_bold= -thumbnail_mouseover_highlighted_background_color= -thumbnail_mouseover_highlighted_foreground_color= -thumbnail_mouseover_highlighted_bold= diff --git a/Plugins/EveryThing/64/Everything.ini b/Plugins/EveryThing/64/Everything.ini deleted file mode 100644 index 96261b6..0000000 --- a/Plugins/EveryThing/64/Everything.ini +++ /dev/null @@ -1,740 +0,0 @@ -; Please make sure Everything is not running before modifying this file. -[Everything] -run_as_admin=0 -allow_http_server=1 -allow_etp_server=1 -window_x=0 -window_y=0 -window_wide=0 -window_high=0 -maximized=0 -minimized=0 -fullscreen=0 -ontop=0 -bring_into_view=1 -alpha=255 -match_whole_word=0 -match_path=0 -match_case=0 -match_diacritics=0 -match_regex=0 -view=0 -thumbnail_size=64 -thumbnail_fill=0 -min_thumbnail_size=32 -max_thumbnail_size=256 -medium_thumbnail_size=64 -large_thumbnail_size=128 -extra_large_thumbnail_size=256 -thumbnail_load_size=0 -thumbnail_overlay_icon=1 -shell_max_path=0 -allow_multiple_windows=0 -allow_multiple_instances=0 -run_in_background=1 -show_in_taskbar=0 -show_tray_icon=0 -minimize_to_tray=0 -toggle_window_from_tray_icon=0 -alternate_row_color=0 -show_mouseover=0 -check_for_updates_on_startup=0 -beta_updates=0 -show_highlighted_search_terms=1 -text_size=0 -hide_empty_search_results=0 -clear_selection_on_search=1 -show_focus_on_search=0 -new_window_key=0 -show_window_key=0 -toggle_window_key=0 -language=0 -show_selected_item_in_statusbar=1 -statusbar_selected_item_format= -show_size_in_statusbar=0 -statusbar_size_format=0 -open_folder_command2= -open_file_command2= -open_path_command2= -explore_command2= -explore_path_command2= -window_title_format= -taskbar_notification_title_format= -instance_name=GeekDesk_EveryThing -translucent_selection_rectangle_alpha=70 -min_zoom=-6 -max_zoom=27 -context_menu_type=0 -context_menu_shell_extensions=1 -auto_include_fixed_volumes=1 -auto_include_removable_volumes=0 -auto_remove_offline_ntfs_volumes=1 -auto_remove_moved_ntfs_volumes=1 -auto_include_fixed_refs_volumes=1 -auto_include_removable_refs_volumes=0 -auto_remove_offline_refs_volumes=1 -auto_remove_moved_refs_volumes=1 -find_mount_points_on_removable_volumes=0 -scan_volume_drive_letters=1 -last_export_type=0 -max_threads=0 -reuse_threads=1 -find_subfolders_and_files_max_threads=0 -single_parent_context_menu=0 -auto_size_1=512 -auto_size_2=640 -auto_size_3=768 -auto_size_aspect_ratio_x=9 -auto_size_aspect_ratio_y=7 -auto_size_width_only=0 -auto_size_path_x=1 -auto_size_path_y=2 -sticky_vscroll_bottom=1 -last_options_page=2 -draw_focus_rect=1 -date_format= -time_format= -listview_item_high=0 -single_click_open=0 -underline_icon_titles=0 -icons_only=0 -icon_shell_extensions=1 -auto_scroll_repeat_delay=250 -auto_scroll_repeat_rate=50 -open_many_files_warning_threshold=16 -set_foreground_window_attach_thread_input=0 -debug=0 -debug_log=0 -verbose=0 -lvm=1 -ipc=1 -home_match_case=1 -home_match_whole_word=0 -home_match_path=0 -home_match_diacritics=0 -home_regex=0 -home_search=1 -home_filter=0 -home_sort=0 -home_view=0 -home_index=1 -allow_multiple_windows_from_tray=0 -single_click_tray=0 -close_on_execute=0 -double_click_path=0 -update_display_after_scroll=0 -update_display_after_mask=1 -auto_scroll_view=0 -double_quote_copy_as_path=0 -snap=0 -snaplen=10 -rename_select_filepart_only=1 -rename_move_caret_to_selection_end=0 -rename_nav=0 -search_edit_move_caret_to_selection_end=0 -search_edit_drag_accept_files=0 -select_search_on_mouse_click=1 -focus_search_on_activate=0 -reset_vscroll_on_search=1 -wrap_focus=0 -load_icon_priority=0 -load_thumbnail_priority=0 -load_fileinfo_priority=0 -always_request_all_fileinfo=0 -header_high=0 -hide_on_close=0 -max_hidden_windows=0 -winmm=0 -menu_escape_amp=1 -menu_folders=0 -menu_folder_separator= -menu_items_per_column=0 -new_inherit=1 -full_row_select=0 -tray_show_command_line= -dpi=96 -ctrl_mouse_wheel_action=1 -lvm_scroll=1 -allow_open=1 -allow_context_menu=1 -allow_delete=1 -allow_rename=1 -allow_cut=1 -allow_copy=1 -allow_paste=1 -allow_drag_drop=1 -allow_window_message_filter_dragdrop=0 -auto_column_widths=0 -hotkey_explorer_path_search=0 -hotkey_user_notification_state=0 -get_key_name_text=1 -paste_new_line_op=0 -esc_cancel_action=1 -fast_ascii_search=1 -match_path_when_search_contains_path_separator=1 -allow_literal_operators=0 -allow_round_bracket_parenthesis=0 -expand_environment_variables=0 -search_as_you_type=1 -always_update_query_on_search_parameter_change=0 -convert_forward_slash_to_backslash=0 -match_whole_filename_when_using_wildcards=1 -operator_precedence=0 -replace_exact_trailing_star_dot_star_with_star=1 -allow_exclamation_point_not=1 -search_command_prefix= -auto_complete_search_command=1 -double_buffer=1 -search= -show_number_of_results_with_selection=0 -date_descending_first=1 -size_descending_first=1 -size_format=2 -alpha_select=0 -tooltips=1 -listview_tooltips=1 -show_detailed_listview_tooltips=1 -rtl_listview_edit=0 -force_path_ltr_order=1 -force_path_left_align=1 -date_time_order=0 -date_time_align=1 -size_align=3 -invert_layout=0 -update_layout_on_input_language_change=0 -control_shift_action=3 -change_search_rtl_reading_action=3 -invert_layout_action=3 -bookmark_remember_case=1 -bookmark_remember_wholeword=1 -bookmark_remember_path=1 -bookmark_remember_diacritic=1 -bookmark_remember_regex=1 -bookmark_remember_sort=1 -bookmark_remember_view=1 -bookmark_remember_filter=1 -bookmark_remember_index=1 -bookmark_remember_search=1 -bookmark_organize_x=0 -bookmark_organize_y=0 -bookmark_organize_wide=0 -bookmark_organize_high=0 -exclude_list_enabled=1 -exclude_hidden_files_and_folders=0 -exclude_system_files_and_folders=0 -include_only_files= -exclude_files= -db_location= -db_multi_user_filename=0 -db_compress=0 -index_size=1 -fast_size_sort=1 -index_date_created=0 -fast_date_created_sort=0 -index_date_modified=1 -fast_date_modified_sort=1 -index_date_accessed=0 -fast_date_accessed_sort=0 -index_attributes=0 -fast_attributes_sort=0 -index_folder_size=0 -fast_path_sort=1 -fast_extension_sort=0 -extended_information_cache_monitor=1 -db_update_thread_priority=-15 -index_recent_changes=1 -refs_file_id_extd_directory_info_buffer_size=0 -folder_update_thread_mode_background=0 -folder_update_rescan_asap=1 -monitor_thread_mode_background=1 -monitor_retry_delay=30000 -monitor_update_delay=1000 -monitor_pause=0 -usn_record_filter=0xffffffff -cancel_delay=0x000003e8 -allow_ntfs_open_file_by_id=1 -always_update_folder_recent_change=0 -editor_x=0 -editor_y=0 -editor_wide=0 -editor_high=0 -editor_maximized=0 -file_list_relative_paths=0 -rename_x=0 -rename_y=0 -rename_wide=0 -rename_high=0 -rename_match_case=0 -rename_regex=0 -advanced_copy_to_x=0 -advanced_copy_to_y=0 -advanced_copy_to_wide=0 -advanced_copy_to_high=0 -advanced_copy_to_match_case=0 -advanced_copy_to_regex=0 -advanced_move_to_x=0 -advanced_move_to_y=0 -advanced_move_to_wide=0 -advanced_move_to_high=0 -advanced_move_to_match_case=0 -advanced_move_to_regex=0 -advanced_search_x=0 -advanced_search_y=0 -advanced_search_wide=0 -advanced_search_high=0 -advanced_search_page_y_offset=0 -advanced_search_focus_id=0 -advanced_search_warnings=1 -max_recv_size=8388608 -display_full_path_name=0 -size_tiny=10240 -size_small=102400 -size_medium=1048576 -size_large=16777216 -size_huge=134217728 -themed_toolbar=1 -show_copy_name=2 -show_copy_path=2 -show_copy_full_name=2 -show_open_path=2 -show_explore=2 -show_explore_path=2 -copy_path_folder_append_backslash=0 -custom_verb01= -custom_verb02= -custom_verb03= -custom_verb04= -custom_verb05= -custom_verb06= -custom_verb07= -custom_verb08= -custom_verb09= -custom_verb10= -custom_verb11= -custom_verb12= -filters_visible=0 -filters_wide=128 -filters_right_align=1 -filters_tab_stop=0 -filter= -filter_everything_name= -filter_organize_x=0 -filter_organize_y=0 -filter_organize_wide=0 -filter_organize_high=0 -preview_visible=0 -preview_x=640 -preview_tab_stop=0 -preview_mag_filter=0 -preview_min_filter=0 -preview_fill=0 -show_preview_handlers_in_preview_pane=0 -preview_load_size=0 -preview_context=0x00000000 -preview_release_handler_on_clear=0 -sort=Run Count -sort_ascending=0 -always_keep_sort=0 -index=0 -index_file_list= -index_etp_server= -index_link_type=1 -status_bar_visible=1 -select_search_on_focus_mode=1 -select_search_on_set_mode=2 -search_history_enabled=0 -run_history_enabled=0 -search_history_days_to_keep=90 -run_history_days_to_keep=90 -search_history_keep_forever=1 -run_history_keep_forever=1 -search_history_always_suggest=0 -search_history_always_suggest_extend_toolbar=0 -search_history_visible_count_max=12 -search_history_always_suggest_visible_count_max=1 -search_history_show_all_max=256 -search_history_suggestion_max=256 -search_history_show_all_sort=2 -search_history_suggestion_sort=1 -search_history_show_above=0 -search_history_sort=2 -search_history_sort_ascending=0 -search_history_x=0 -search_history_y=0 -search_history_wide=0 -search_history_high=0 -search_history_column_search_wide=208 -search_history_column_search_order=0 -search_history_column_count_wide=128 -search_history_column_count_order=1 -search_history_column_date_wide=128 -search_history_column_date_order=2 -etp_server_enabled=0 -etp_server_bindings= -etp_server_port=21 -etp_server_username= -etp_server_password= -etp_server_welcome_message= -etp_server_log_file_name= -etp_server_logging_enabled=0 -etp_server_log_max_size=4194304 -etp_server_log_delta_size=524288 -etp_server_allow_file_download=1 -ftp_allow_port=1 -ftp_check_data_connection_ip=1 -http_server_enabled=0 -http_server_bindings= -http_title_format= -http_server_port=80 -http_server_username= -http_server_password= -http_server_home= -http_server_default_page= -http_server_log_file_name= -http_server_logging_enabled=0 -http_server_log_max_size=4194304 -http_server_log_delta_size=524288 -http_server_allow_file_download=1 -http_server_items_per_page=32 -http_server_show_drive_labels=0 -http_server_strings= -http_server_header= -service_pipe_name= -name_column_pos=0 -name_column_width=256 -path_column_visible=1 -path_column_pos=1 -path_column_width=256 -size_column_visible=1 -size_column_pos=2 -size_column_width=96 -extension_column_visible=0 -extension_column_pos=3 -extension_column_width=96 -type_column_visible=0 -type_column_pos=4 -type_column_width=96 -last_write_time_column_visible=1 -last_write_time_column_pos=3 -last_write_time_column_width=153 -creation_time_column_visible=0 -creation_time_column_pos=6 -creation_time_column_width=153 -date_accessed_column_visible=0 -date_accessed_column_pos=7 -date_accessed_column_width=153 -attribute_column_visible=0 -attribute_column_pos=8 -attribute_column_width=70 -date_recently_changed_column_visible=0 -date_recently_changed_column_pos=9 -date_recently_changed_column_width=153 -run_count_column_visible=0 -run_count_column_pos=10 -run_count_column_width=96 -date_run_column_visible=0 -date_run_column_pos=11 -date_run_column_width=153 -file_list_filename_column_visible=0 -file_list_filename_column_pos=12 -file_list_filename_column_width=96 -translucent_selection_rectangle_background_color= -translucent_selection_rectangle_border_color= -thumbnail_mouseover_border_color= -preview_background_color= -ntfs_volume_guids="\\\\?\\Volume{6afe1915-0a0b-4e59-96bc-666ff914ea4f}","\\\\?\\Volume{71be44cf-e03a-462f-a9c8-b53c16e002a4}" -ntfs_volume_paths="C:","D:" -ntfs_volume_roots="","" -ntfs_volume_includes=1,1 -ntfs_volume_load_recent_changes=0,0 -ntfs_volume_include_onlys="","" -ntfs_volume_monitors=1,1 -refs_volume_guids= -refs_volume_paths= -refs_volume_roots= -refs_volume_includes= -refs_volume_load_recent_changes= -refs_volume_include_onlys= -refs_volume_monitors= -filelists= -filelist_monitor_changes= -folders= -folder_monitor_changes= -folder_buffer_size_list= -folder_rescan_if_full_list= -folder_update_types= -folder_update_days= -folder_update_ats= -folder_update_intervals= -folder_update_interval_types= -exclude_folders= -connect_history_hosts= -connect_history_ports= -connect_history_usernames= -connect_history_link_types= -etp_client_rewrite_patterns= -etp_client_rewrite_substitutions= -file_new_search_window_keys=334 -file_open_file_list_keys=335 -file_close_file_list_keys= -file_close_keys=343,27 -file_export_keys=339 -file_copy_full_name_to_clipboard_keys=9539 -file_copy_path_to_clipboard_keys= -file_set_run_count_keys= -file_create_shortcut_keys= -file_delete_keys=8238 -file_delete_permanently_keys=9262 -file_edit_keys= -file_open_keys=8205 -file_open_selection_and_close_everything_keys= -file_explore_path_keys= -file_open_new_keys= -file_open_path_keys=8461 -file_open_with_keys= -file_open_with_default_verb_keys= -file_play_keys= -file_preview_keys= -file_print_keys= -file_print_to_keys= -file_properties_keys=8717 -file_read_extended_information_keys=8517 -file_rename_keys=8305 -file_run_as_keys= -file_exit_keys=337 -file_copy_name_to_clipboard_keys= -file_open_selection_and_do_not_close_everything_keys= -file_open_most_run_keys= -file_open_last_run_keys= -file_custom_verb_1_keys= -file_custom_verb_2_keys= -file_custom_verb_3_keys= -file_custom_verb_4_keys= -file_custom_verb_5_keys= -file_custom_verb_6_keys= -file_custom_verb_7_keys= -file_custom_verb_8_keys= -file_custom_verb_9_keys= -file_custom_verb_10_keys= -file_custom_verb_11_keys= -file_custom_verb_12_keys= -indexes_folders_rescan_all_now_keys= -indexes_force_rebuild_keys= -edit_cut_keys=8536 -edit_copy_keys=8515,8493 -edit_paste_keys=8534,9261 -edit_select_all_keys=8513 -edit_invert_selection_keys= -edit_copy_to_folder_keys= -edit_move_to_folder_keys= -edit_advanced_advanced_copy_to_folder_keys= -edit_advanced_advanced_move_to_folder_keys= -view_filters_keys= -view_preview_keys=592 -view_status_bar_keys= -view_details_keys=1334 -view_medium_thumbnails_keys=1331 -view_large_thumbnails_keys=1330 -view_extra_large_thumbnails_keys=1329 -view_increase_thumbnail_size_keys=1467 -view_decrease_thumbnail_size_keys=1469 -view_window_size_small_keys=561 -view_window_size_medium_keys=562 -view_window_size_large_keys=563 -view_window_size_auto_fit_keys=564 -view_zoom_zoom_in_keys=443 -view_zoom_zoom_out_keys=445 -view_zoom_reset_keys=304,352 -view_go_to_back_keys=549,166 -view_go_to_forward_keys=551,167 -view_go_to_home_keys=548 -view_go_to_show_all_history_keys=1352,328 -view_sort_by_name_keys=305 -view_sort_by_path_keys=306 -view_sort_by_size_keys=307 -view_sort_by_extension_keys=308 -view_sort_by_type_keys=309 -view_sort_by_date_modified_keys=310 -view_sort_by_date_created_keys=311 -view_sort_by_attributes_keys=312 -view_sort_by_file_list_filename_keys= -view_sort_by_run_count_keys= -view_sort_by_date_run_keys= -view_sort_by_date_recently_changed_keys=313 -view_sort_by_date_accessed_keys= -view_sort_by_ascending_keys= -view_sort_by_descending_keys= -view_refresh_keys=116 -view_fullscreen_keys=122 -view_toggle_ltrrtl_direction_keys= -view_on_top_never_keys= -view_on_top_always_keys= -view_on_top_while_searching_keys= -search_match_case_keys=329 -search_match_whole_word_keys=322 -search_match_path_keys=341 -search_match_diacritics_keys=333 -search_enable_regex_keys=338 -search_advanced_search_keys= -search_add_to_filters_keys= -search_organize_filters_keys=1350 -bookmarks_add_to_bookmarks_keys=324 -bookmarks_organize_bookmarks_keys=1346 -tools_options_keys=336 -tools_console_keys=448 -tools_file_list_editor_keys= -tools_connect_to_etp_server_keys= -tools_disconnect_from_etp_server_keys= -help_everything_help_keys=112 -help_search_syntax_keys= -help_regex_syntax_keys= -help_command_line_options_keys= -help_everything_website_keys= -help_check_for_updates_keys= -help_about_everything_keys=368 -help_donate_keys= -search_edit_focus_search_edit_keys=326,114,580 -search_edit_delete_previous_word_keys=4360 -search_edit_auto_complete_search_keys=4384 -search_edit_show_search_history_keys= -search_edit_show_all_search_history_keys=4646,4648 -result_list_item_up_keys=8230,4134 -result_list_item_down_keys=8232,4136 -result_list_page_up_keys=8225,4129 -result_list_page_down_keys=8226,4130 -result_list_start_of_list_keys=8228 -result_list_end_of_list_keys=8227 -result_list_item_up_extend_keys=9254,5158 -result_list_item_down_extend_keys=9256,5160 -result_list_page_up_extend_keys=9249,5153 -result_list_page_down_extend_keys=9250,5154 -result_list_start_of_list_extend_keys=9252 -result_list_end_of_list_extend_keys=9251 -result_list_focus_up_keys=8486,4390 -result_list_focus_down_keys=8488,4392 -result_list_focus_page_up_keys=8481,4385 -result_list_focus_page_down_keys=8482,4386 -result_list_focus_start_of_list_keys=8484 -result_list_focus_end_of_list_keys=8483 -result_list_focus_up_extend_keys=9510,5414 -result_list_focus_down_extend_keys=9512,5416 -result_list_focus_page_up_extend_keys=9505,5409 -result_list_focus_page_down_extend_keys=9506,5410 -result_list_focus_start_of_list_extend_keys=9508 -result_list_focus_end_of_list_extend_keys=9507 -result_list_focus_result_list_keys= -result_list_focus_highest_run_count_result_keys= -result_list_focus_last_run_result_keys= -result_list_toggle_path_column_keys= -result_list_toggle_size_column_keys= -result_list_toggle_extension_column_keys= -result_list_toggle_type_column_keys= -result_list_toggle_date_modified_column_keys= -result_list_toggle_date_created_column_keys= -result_list_toggle_attributes_column_keys= -result_list_toggle_file_list_filename_column_keys= -result_list_toggle_run_count_column_keys= -result_list_toggle_date_recently_changed_column_keys= -result_list_toggle_date_accessed_column_keys= -result_list_toggle_date_run_column_keys= -result_list_size_all_columns_to_fit_keys=8555 -result_list_size_result_list_to_fit_keys= -result_list_context_menu_keys=9337 -result_list_scroll_left_or_thumbnail_left_keys=8229 -result_list_scroll_right_or_thumbnail_right_keys=8231 -result_list_scroll_page_left_or_thumbnail_focus_left_keys=8485 -result_list_scroll_page_right_or_thumbnail_focus_right_keys=8487 -result_list_left_extend_keys=9253 -result_list_right_extend_keys=9255 -result_list_focus_left_extend_keys=9509 -result_list_focus_right_extend_keys=9511 -result_list_select_focus_keys=8224 -result_list_toggle_focus_selection_keys=8480 -result_list_copy_as_csv_keys= -preview_focus_preview_keys= -result_list_font= -result_list_font_size= -search_edit_font= -search_edit_font_size= -status_bar_font= -status_bar_font_size= -header_font= -header_font_size= -normal_background_color= -normal_foreground_color= -normal_bold= -highlighted_background_color= -highlighted_foreground_color= -highlighted_bold= -current_sort_background_color= -current_sort_foreground_color= -current_sort_bold= -current_sort_highlighted_background_color= -current_sort_highlighted_foreground_color= -current_sort_highlighted_bold= -selected_background_color= -selected_foreground_color= -selected_bold= -selected_highlighted_background_color= -selected_highlighted_foreground_color= -selected_highlighted_bold= -selected_inactive_background_color= -selected_inactive_foreground_color= -selected_inactive_bold= -selected_inactive_highlighted_background_color= -selected_inactive_highlighted_foreground_color= -selected_inactive_highlighted_bold= -drop_target_background_color= -drop_target_foreground_color= -drop_target_bold= -drop_target_highlighted_background_color= -drop_target_highlighted_foreground_color= -drop_target_highlighted_bold= -mouseover_background_color= -mouseover_foreground_color= -mouseover_bold= -mouseover_highlighted_background_color= -mouseover_highlighted_foreground_color= -mouseover_highlighted_bold= -mouseover_current_sort_background_color= -mouseover_current_sort_foreground_color= -mouseover_current_sort_bold= -mouseover_current_sort_highlighted_background_color= -mouseover_current_sort_highlighted_foreground_color= -mouseover_current_sort_highlighted_bold= -alternate_row_background_color= -alternate_row_foreground_color= -alternate_row_bold= -alternate_row_highlighted_background_color= -alternate_row_highlighted_foreground_color= -alternate_row_highlighted_bold= -current_sort_alternate_row_background_color= -current_sort_alternate_row_foreground_color= -current_sort_alternate_row_bold= -current_sort_alternate_row_highlighted_background_color= -current_sort_alternate_row_highlighted_foreground_color= -current_sort_alternate_row_highlighted_bold= -hot_background_color= -hot_foreground_color= -hot_bold= -hot_highlighted_background_color= -hot_highlighted_foreground_color= -hot_highlighted_bold= -selected_hot_background_color= -selected_hot_foreground_color= -selected_hot_bold= -selected_hot_highlighted_background_color= -selected_hot_highlighted_foreground_color= -selected_hot_highlighted_bold= -selected_inactive_hot_background_color= -selected_inactive_hot_foreground_color= -selected_inactive_hot_bold= -selected_inactive_hot_highlighted_background_color= -selected_inactive_hot_highlighted_foreground_color= -selected_inactive_hot_highlighted_bold= -thumbnail_mouseover_background_color= -thumbnail_mouseover_foreground_color= -thumbnail_mouseover_bold= -thumbnail_mouseover_highlighted_background_color= -thumbnail_mouseover_highlighted_foreground_color= -thumbnail_mouseover_highlighted_bold= diff --git a/Plugins/EveryThing/EveryThing32.cs b/Plugins/EveryThing/EveryThing32.cs index 8035bbb..091472d 100644 --- a/Plugins/EveryThing/EveryThing32.cs +++ b/Plugins/EveryThing/EveryThing32.cs @@ -119,5 +119,8 @@ namespace GeekDesk.Plugins.EveryThing public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount); [DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")] public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName); + + [DllImport(@"lib\Plugins\EveryThing\lib\Everything32.dll")] + public static extern bool Everything_Exit(); } } diff --git a/Plugins/EveryThing/EveryThing64.cs b/Plugins/EveryThing/EveryThing64.cs index d867ede..67f582b 100644 --- a/Plugins/EveryThing/EveryThing64.cs +++ b/Plugins/EveryThing/EveryThing64.cs @@ -119,5 +119,8 @@ namespace GeekDesk.Plugins.EveryThing public static extern bool Everything_SetRunCountFromFileName(string lpFileName, UInt32 dwRunCount); [DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")] public static extern UInt32 Everything_IncRunCountFromFileName(string lpFileName); + + [DllImport(@"lib\Plugins\EveryThing\lib\Everything64.dll")] + public static extern bool Everything_Exit(); } } diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index 9fd2eb5..9f20c7e 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -1,35 +1,270 @@ -using System; +using GeekDesk.Constant; +using GeekDesk.Plugins.EveryThing.Constant; +using GeekDesk.Util; +using GeekDesk.ViewModel; +using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace GeekDesk.Plugins.EveryThing { + public class EveryThingUtil { + //检查是否是由GeekDesk启动的EveryThing + private static bool IsByGeekDesk = true; + //每次加载20条 + private static long pageCount = 20; + private static UInt32 ui = 0; - public static void StartEveryThing(String pluginsPath) + public static void EnableEveryThing() { - bool Is64Bit = Environment.Is64BitOperatingSystem; - string pluginPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe"; + string pluginsPath = Constants.PLUGINS_PATH; - //启动服务 - using (Process p = new Process()) + bool Is64Bit = Environment.Is64BitOperatingSystem; + string everyThingPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe"; + + new Thread(() => { - p.StartInfo.FileName = pluginPath; - p.StartInfo.UseShellExecute = true; - p.StartInfo.Arguments = " -svc"; - p.Start(); + + Thread.Sleep(2000); + + //判断EveryThing服务是否已启动 + bool enabled = false; + Process[] processList = Process.GetProcesses(); + foreach (System.Diagnostics.Process process in processList) + { + if (process.ProcessName.ToUpper().Equals("EVERYTHING")) + { + enabled = true; + IsByGeekDesk = false; + break; + } + } + + if (!enabled) + { + //启动服务 + using (Process p = new Process()) + { + p.StartInfo.FileName = everyThingPath; + p.StartInfo.UseShellExecute = true; + p.StartInfo.Verb = "runas"; + p.StartInfo.Arguments = " -svc"; + p.Start(); + } + } + + Thread.Sleep(2000); + processList = Process.GetProcesses(); + + + //启动程序 + using (Process p = new Process()) + { + p.StartInfo.FileName = everyThingPath; + p.Start(); + int waitTime = 3000; + while (true && waitTime > 0) + { + Thread.Sleep(100); + waitTime -= 100; + p.CloseMainWindow(); + } + + } + }).Start(); + + } + + + + public static void DisableEveryThing() + { + if (IsByGeekDesk) + { + if (Environment.Is64BitOperatingSystem) + { + EveryThing64.Everything_Exit(); + } else + { + EveryThing32.Everything_Exit(); + } } - //启动程序 - using (Process p = new Process()) + + } + + + public static bool hasNext() + { + return ui < Everything_GetNumResults(); + } + + + public static ObservableCollection Search(string text) + { + ui = 0; + //EveryThing全盘搜索 + Everything_Reset(); + EveryThingUtil.Everything_SetSearchW(text); + EveryThingUtil.Everything_SetRequestFlags( + EveryThingConst.EVERYTHING_REQUEST_FILE_NAME + | EveryThingConst.EVERYTHING_REQUEST_PATH + | EveryThingConst.EVERYTHING_REQUEST_DATE_MODIFIED + | EveryThingConst.EVERYTHING_REQUEST_SIZE); + EveryThingUtil.Everything_SetSort(13); + EveryThingUtil.Everything_QueryW(true); + return NextPage(); + } + + public static ObservableCollection NextPage() + { + string filePath; + const int bufsize = 260; + StringBuilder buf = new StringBuilder(bufsize); + ObservableCollection iconBakList = new ObservableCollection(); + for (long count = 0; ui < Everything_GetNumResults() && count < pageCount; count++, ui++) { - p.StartInfo.FileName = pluginPath; - p.Start(); + buf.Clear(); + EveryThingUtil.Everything_GetResultFullPathName(ui, buf, bufsize); + filePath = buf.ToString(); + + string tempPath = filePath; + + string ext = ""; + if (!ImageUtil.IsSystemItem(filePath)) + { + ext = System.IO.Path.GetExtension(filePath).ToLower(); + } + + if (".lnk".Equals(ext)) + { + + string targetPath = FileUtil.GetTargetPathByLnk(filePath); + if (targetPath != null) + { + filePath = targetPath; + } + } + + + string name = System.IO.Path.GetFileNameWithoutExtension(tempPath); + if (String.IsNullOrEmpty(name)) + { + name = tempPath.Substring(tempPath.LastIndexOf("\\")); + } + + IconInfo iconInfo = new IconInfo + { + Path_NoWrite = filePath, + LnkPath_NoWrite = tempPath, + BitmapImage_NoWrite = null, + StartArg_NoWrite = FileUtil.GetArgByLnk(tempPath), + Name_NoWrite = name, + }; + + //缓存信息 异步加载图标 + iconBakList.Add(iconInfo); + } + return iconBakList; + } + + + + + + + public static UInt32 Everything_SetSearchW(string lpSearchString) + { + if (Environment.Is64BitOperatingSystem) + { + return EveryThing64.Everything_SetSearchW(lpSearchString); + } else + { + return EveryThing32.Everything_SetSearchW(lpSearchString); } } + + public static void Everything_SetRequestFlags(UInt32 dwRequestFlags) + { + if (Environment.Is64BitOperatingSystem) + { + EveryThing64.Everything_SetRequestFlags(dwRequestFlags); + } + else + { + EveryThing32.Everything_SetRequestFlags(dwRequestFlags); + } + } + + public static void Everything_SetSort(UInt32 dwSortType) + { + if (Environment.Is64BitOperatingSystem) + { + EveryThing64.Everything_SetSort(dwSortType); + } + else + { + EveryThing32.Everything_SetSort(dwSortType); + } + } + + public static bool Everything_QueryW(bool bWait) + { + if (Environment.Is64BitOperatingSystem) + { + return EveryThing64.Everything_QueryW(bWait); + } + else + { + return EveryThing32.Everything_QueryW(bWait); + } + } + + + public static UInt32 Everything_GetNumResults() + { + if (Environment.Is64BitOperatingSystem) + { + return EveryThing64.Everything_GetNumResults(); + } + else + { + return EveryThing32.Everything_GetNumResults(); + } + } + + + public static void Everything_GetResultFullPathName(UInt32 nIndex, StringBuilder lpString, UInt32 nMaxCount) + { + if (Environment.Is64BitOperatingSystem) + { + EveryThing64.Everything_GetResultFullPathName(nIndex, lpString, nMaxCount); + } + else + { + EveryThing32.Everything_GetResultFullPathName(nIndex, lpString, nMaxCount); + } + } + + public static void Everything_Reset() + { + if (Environment.Is64BitOperatingSystem) + { + EveryThing64.Everything_Reset(); + } + else + { + EveryThing32.Everything_Reset(); + } + } + + } } diff --git a/Util/CommonCode.cs b/Util/CommonCode.cs index 6985d3f..0b3ad8b 100644 --- a/Util/CommonCode.cs +++ b/Util/CommonCode.cs @@ -255,6 +255,7 @@ namespace GeekDesk.Util + /// /// 排序图标 /// diff --git a/Util/ImageUtil.cs b/Util/ImageUtil.cs index d2db7c9..0c40f86 100644 --- a/Util/ImageUtil.cs +++ b/Util/ImageUtil.cs @@ -121,6 +121,34 @@ namespace GeekDesk.Util } + public static BitmapImage GetBitmapIconByUnknownPath(string path) + { + //string base64 = ImageUtil.FileImageToBase64(path, System.Drawing.Imaging.ImageFormat.Png); + string ext = ""; + if (!ImageUtil.IsSystemItem(path)) + { + ext = System.IO.Path.GetExtension(path).ToLower(); + } + + string iconPath = null; + if (".lnk".Equals(ext)) + { + + string targetPath = FileUtil.GetTargetPathByLnk(path); + iconPath = FileUtil.GetIconPathByLnk(path); + if (targetPath != null) + { + path = targetPath; + } + } + if (StringUtil.IsEmpty(iconPath)) + { + iconPath = path; + } + + return ImageUtil.GetBitmapIconByPath(iconPath); + } + /// /// /// diff --git a/ViewModel/AppConfig.cs b/ViewModel/AppConfig.cs index c547050..29af1c9 100644 --- a/ViewModel/AppConfig.cs +++ b/ViewModel/AppConfig.cs @@ -105,6 +105,23 @@ namespace GeekDesk.ViewModel private bool? secondsWindow; //秒数窗口 默认打开 + private bool? enableEveryThing; + + + public bool? EnableEveryThing + { + get + { + if (enableEveryThing == null) enableEveryThing = false; + return enableEveryThing; + } + set + { + enableEveryThing = value; + OnPropertyChanged("EnableEveryThing"); + } + } + #region GetSet public bool? SecondsWindow diff --git a/ViewModel/IconInfo.cs b/ViewModel/IconInfo.cs index c83ae52..e26c6dd 100644 --- a/ViewModel/IconInfo.cs +++ b/ViewModel/IconInfo.cs @@ -283,6 +283,7 @@ namespace GeekDesk.ViewModel { bitmapImage = value; ImageByteArr_NoWrite = ImageUtil.BitmapImageToByte(bitmapImage); + OnPropertyChanged("BitmapImage_NoWrite"); } } @@ -346,7 +347,10 @@ namespace GeekDesk.ViewModel private void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH); + if (propertyName!=null && propertyName.Contains("NoWrite")) + { + CommonCode.SaveAppData(MainWindow.appData, Constants.DATA_FILE_PATH); + } } diff --git a/ViewModel/Temp/SearchIconList.cs b/ViewModel/Temp/SearchIconList.cs index 0bc800c..ebfd24d 100644 --- a/ViewModel/Temp/SearchIconList.cs +++ b/ViewModel/Temp/SearchIconList.cs @@ -21,8 +21,15 @@ namespace GeekDesk.ViewModel.Temp } } + public static void RemoveAll() + { + while (IconList.Count > 0) + { + IconList.RemoveAt(IconList.Count - 1); + } + } - public static event PropertyChangedEventHandler PropertyChanged; + private static event PropertyChangedEventHandler PropertyChanged; private static void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName)); diff --git a/app.manifest b/app.manifest index 18555fc..6fba0cd 100644 --- a/app.manifest +++ b/app.manifest @@ -1,6 +1,6 @@  - + @@ -18,48 +18,41 @@ --> + + + + - - - - - - - - - true true - - - - + \ No newline at end of file diff --git a/packages.config b/packages.config index 7335133..fe5f804 100644 --- a/packages.config +++ b/packages.config @@ -1,7 +1,7 @@  - + From 4b5cc7b7ebfd393bce7db8c9dc29f28da718408b Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 31 Mar 2023 18:17:24 +0800 Subject: [PATCH 08/44] =?UTF-8?q?:tada:=20=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E7=BD=AE=E4=BA=8E=E9=A1=B6=E5=B1=82=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/Config/ThemeControl.xaml | 12 +- .../UserControls/Config/ThemeControl.xaml.cs | 2 +- .../PannelCard/RightCardControl.xaml.cs | 4 +- Control/Windows/ConfigWindow.xaml | 2 +- GeekDesk.csproj | 3 +- MainWindow.xaml | 3 +- MainWindow.xaml.cs | 22 +-- Plugins/EveryThing/EveryThingUtil.cs | 77 +++++----- Util/DelayHelper.cs | 34 ----- Util/DelayHelperFlyoutMenuItem.cs | 20 --- Util/WindowUtil.cs | 141 ++++++++++++++++++ ViewModel/AppConfig.cs | 16 ++ 12 files changed, 228 insertions(+), 108 deletions(-) delete mode 100644 Util/DelayHelper.cs delete mode 100644 Util/DelayHelperFlyoutMenuItem.cs create mode 100644 Util/WindowUtil.cs diff --git a/Control/UserControls/Config/ThemeControl.xaml b/Control/UserControls/Config/ThemeControl.xaml index 0159ffc..19be6ef 100644 --- a/Control/UserControls/Config/ThemeControl.xaml +++ b/Control/UserControls/Config/ThemeControl.xaml @@ -109,8 +109,18 @@ - + + + + + + + + + + + diff --git a/Control/UserControls/Config/ThemeControl.xaml.cs b/Control/UserControls/Config/ThemeControl.xaml.cs index 2640e71..64c3f66 100644 --- a/Control/UserControls/Config/ThemeControl.xaml.cs +++ b/Control/UserControls/Config/ThemeControl.xaml.cs @@ -167,6 +167,6 @@ namespace GeekDesk.Control.UserControls.Config } appConfig.IsShow = null; } - + } } diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml.cs b/Control/UserControls/PannelCard/RightCardControl.xaml.cs index 452026e..3d54f10 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/RightCardControl.xaml.cs @@ -1051,10 +1051,10 @@ namespace GeekDesk.Control.UserControls.PannelCard private void VerticalCard_ScrollChanged(object sender, ScrollChangedEventArgs e) { - if (appData.AppConfig.EnableEveryThing == true && EveryThingUtil.hasNext()) + if (appData.AppConfig.EnableEveryThing == true && EveryThingUtil.HasNext()) { HandyControl.Controls.ScrollViewer sv = sender as HandyControl.Controls.ScrollViewer; - if (sv.ExtentHeight - (sv.ActualHeight + sv.VerticalOffset) < 200 && EveryThingUtil.hasNext()) + if (sv.ExtentHeight - (sv.ActualHeight + sv.VerticalOffset) < 200 && EveryThingUtil.HasNext()) { string[] split = MainWindow.mainWindow.TotalMsgBtn.Content.ToString().Split(' '); long count = Convert.ToInt64(split[0]); diff --git a/Control/Windows/ConfigWindow.xaml b/Control/Windows/ConfigWindow.xaml index 02e7063..788f2d5 100644 --- a/Control/Windows/ConfigWindow.xaml +++ b/Control/Windows/ConfigWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF" - xmlns:local="clr-namespace:GeekDesk" + xmlns:local="clr-namespace:GeekDesk" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppConfig}" Title="Setting" mc:Ignorable="d" WindowStartupLocation="CenterScreen" diff --git a/GeekDesk.csproj b/GeekDesk.csproj index edb7e0d..cd73dbb 100644 --- a/GeekDesk.csproj +++ b/GeekDesk.csproj @@ -294,8 +294,6 @@ - - @@ -327,6 +325,7 @@ + diff --git a/MainWindow.xaml b/MainWindow.xaml index 9988053..ab250c8 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -27,7 +27,8 @@ MouseDown="MainWindow_MouseDown" MouseEnter="MainWindow_MouseEnter" GotFocus="Window_GotFocus" - Loaded="Window_Loaded" + Loaded="Window_Loaded" + Topmost="{Binding AppConfig.AlwaysTopmost}" > diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index bd6f0c9..8b5327e 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -44,7 +44,6 @@ namespace GeekDesk public static int toDoHotKeyId = -1; public static int colorPickerHotKeyId = -1; public static MainWindow mainWindow; - DelayHelper searchDelayHelper = new DelayHelper(300); public MainWindow() { //加载数据 @@ -54,9 +53,6 @@ namespace GeekDesk //用于其他类访问 mainWindow = this; - //置于顶层 - this.Topmost = true; - //执行待办提醒 ToDoTask.BackLogCheck(); @@ -354,9 +350,7 @@ namespace GeekDesk //毛玻璃 暂时未解决阴影问题 //BlurGlassUtil.EnableBlur(this); - //开启延迟搜索 优化搜索功能 - searchDelayHelper.Idled += SearchDelay; - + WindowUtil.SetOwner(this, WindowUtil.GetDesktopHandle(this, DesktopLayer.Progman)); if (appData.AppConfig.EnableEveryThing == true) { @@ -364,7 +358,6 @@ namespace GeekDesk EveryThingUtil.EnableEveryThing(); } - Keyboard.Focus(SearchBox); MessageUtil.ChangeWindowMessageFilter(MessageUtil.WM_COPYDATA, 1); @@ -383,7 +376,7 @@ namespace GeekDesk { if (MotionControl.hotkeyFinished) { - if (mainWindow.Visibility == Visibility.Collapsed || mainWindow.Opacity == 0 || MarginHide.IS_HIDE) + if (CheckSholeShowApp()) { ShowApp(); } @@ -587,6 +580,7 @@ namespace GeekDesk ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0); } + MainWindow.mainWindow.Activate(); mainWindow.Show(); //mainWindow.Visibility = Visibility.Visible; @@ -705,7 +699,7 @@ namespace GeekDesk /// private void NotifyIcon_Click(object sender, RoutedEventArgs e) { - if (this.Visibility == Visibility.Collapsed || this.Opacity == 0) + if (CheckSholeShowApp()) { ShowApp(); } @@ -715,6 +709,14 @@ namespace GeekDesk } } + private static bool CheckSholeShowApp() + { + return mainWindow.Visibility == Visibility.Collapsed + || mainWindow.Opacity == 0 + || MarginHide.IS_HIDE + || !WindowUtil.WindowIsTop(mainWindow); + } + /// /// 右键任务栏图标 设置 /// diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index 9f20c7e..e4d00fe 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -32,53 +32,58 @@ namespace GeekDesk.Plugins.EveryThing new Thread(() => { - - Thread.Sleep(2000); - - //判断EveryThing服务是否已启动 - bool enabled = false; - Process[] processList = Process.GetProcesses(); - foreach (System.Diagnostics.Process process in processList) + try { - if (process.ProcessName.ToUpper().Equals("EVERYTHING")) + Thread.Sleep(2000); + + //判断EveryThing服务是否已启动 + bool enabled = false; + Process[] processList = Process.GetProcesses(); + foreach (System.Diagnostics.Process process in processList) { - enabled = true; - IsByGeekDesk = false; - break; + if (process.ProcessName.ToUpper().Equals("EVERYTHING")) + { + enabled = true; + IsByGeekDesk = false; + break; + } } - } - if (!enabled) - { - //启动服务 + if (!enabled) + { + //启动服务 + using (Process p = new Process()) + { + p.StartInfo.FileName = everyThingPath; + p.StartInfo.UseShellExecute = true; + p.StartInfo.Verb = "runas"; + p.StartInfo.Arguments = " -svc"; + p.Start(); + } + } + + Thread.Sleep(2000); + processList = Process.GetProcesses(); + + //启动程序 using (Process p = new Process()) { p.StartInfo.FileName = everyThingPath; - p.StartInfo.UseShellExecute = true; - p.StartInfo.Verb = "runas"; - p.StartInfo.Arguments = " -svc"; p.Start(); + int waitTime = 3000; + while (true && waitTime > 0) + { + Thread.Sleep(100); + waitTime -= 100; + p.CloseMainWindow(); + } + } - } - - Thread.Sleep(2000); - processList = Process.GetProcesses(); - - - //启动程序 - using (Process p = new Process()) + } catch (Exception e) { - p.StartInfo.FileName = everyThingPath; - p.Start(); - int waitTime = 3000; - while (true && waitTime > 0) - { - Thread.Sleep(100); - waitTime -= 100; - p.CloseMainWindow(); - } } + }).Start(); } @@ -101,7 +106,7 @@ namespace GeekDesk.Plugins.EveryThing } - public static bool hasNext() + public static bool HasNext() { return ui < Everything_GetNumResults(); } diff --git a/Util/DelayHelper.cs b/Util/DelayHelper.cs deleted file mode 100644 index 125c35a..0000000 --- a/Util/DelayHelper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace GeekDesk.Util -{ - public class DelayHelper - { - public event EventHandler Idled = delegate { }; - public int WaitingMilliSeconds { get; set; } - - public object Source { get; set; } - - readonly System.Threading.Timer waitingTimer; - - public DelayHelper(int waitingMilliSeconds = 600) - { - WaitingMilliSeconds = waitingMilliSeconds; - waitingTimer = new System.Threading.Timer(p => - { - Idled(this, EventArgs.Empty); - }); - } - - - public void DelayExecute(object source) - { - this.Source = source; - waitingTimer.Change(WaitingMilliSeconds, System.Threading.Timeout.Infinite); - } - } -} diff --git a/Util/DelayHelperFlyoutMenuItem.cs b/Util/DelayHelperFlyoutMenuItem.cs deleted file mode 100644 index 9250cd3..0000000 --- a/Util/DelayHelperFlyoutMenuItem.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace GeekDesk.Util -{ - public class DelayHelperFlyoutMenuItem - { - public DelayHelperFlyoutMenuItem() - { - TargetType = typeof(DelayHelperFlyoutMenuItem); - } - public int Id { get; set; } - public string Title { get; set; } - - public Type TargetType { get; set; } - } -} \ No newline at end of file diff --git a/Util/WindowUtil.cs b/Util/WindowUtil.cs new file mode 100644 index 0000000..0d224b2 --- /dev/null +++ b/Util/WindowUtil.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Forms; +using System.Windows.Interop; + +namespace GeekDesk.Util +{ + public class WindowUtil + { + + public enum GetWindowCmd : uint + { + GW_HWNDFIRST = 0, + GW_HWNDLAST = 1, + GW_HWNDNEXT = 2, + GW_HWNDPREV = 3, + GW_OWNER = 4, + GW_CHILD = 5, + GW_ENABLEDPOPUP = 6 + } + + [Flags] + public enum SetWindowPosFlags + { + SWP_NOSIZE = 0x0001, + SWP_NOMOVE = 0x0002, + SWP_NOZORDER = 0x0004, + SWP_NOREDRAW = 0x0008, + SWP_NOACTIVATE = 0x0010, + SWP_FRAMECHANGED = 0x0020, + SWP_SHOWWINDOW = 0x0040, + SWP_HIDEWINDOW = 0x0080, + SWP_NOCOPYBITS = 0x0100, + SWP_NOOWNERZORDER = 0x0200, + SWP_NOSENDCHANGING = 0x0400 + } + + //取得前台窗口句柄函数 + [DllImport("user32.dll")] + private static extern IntPtr GetForegroundWindow(); + //取得桌面窗口句柄函数 + [DllImport("user32.dll")] + private static extern IntPtr GetDesktopWindow(); + [DllImport("user32.dll", CharSet = CharSet.Auto)] + private static extern IntPtr FindWindow(string className, string windowName); + [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] + private static extern IntPtr GetWindow(HandleRef hWnd, int nCmd); + [DllImport("user32.dll")] + private static extern IntPtr SetParent(IntPtr child, IntPtr parent); + [DllImport("user32.dll", EntryPoint = "GetDCEx", CharSet = CharSet.Auto, ExactSpelling = true)] + private static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, int flags); + [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] + private static extern bool SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, int x, int y, int cx, int cy, int flags); + [DllImport("user32.dll")] + private static extern int ReleaseDC(IntPtr window, IntPtr handle); + + + + public static void SetOwner(Window source, IntPtr parentHandle) + { + WindowInteropHelper helper = new WindowInteropHelper(source); + helper.Owner = parentHandle; + } + + + /// + /// + /// + /// + /// + public static bool WindowIsTop(Window window) + { + IntPtr handle = new WindowInteropHelper(window).Handle; + IntPtr deskHandle = GetDesktopHandle(window, DesktopLayer.Progman); + IntPtr deskHandle2 = GetDesktopHandle(window, DesktopLayer.FolderView); + IntPtr deskHandle3 = GetDesktopHandle(window, DesktopLayer.SHELLDLL); + IntPtr topHandle = GetForegroundWindow(); + return (topHandle.Equals(handle) || topHandle.Equals(deskHandle)); + } + + + + + public const int GW_CHILD = 5; + + public static IntPtr GetDesktopHandle(Window window, DesktopLayer layer) + { + HandleRef hWnd; + IntPtr hDesktop = new IntPtr(); + switch (layer) + { + case DesktopLayer.Progman: + hDesktop = FindWindow("Progman", null);//第一层桌面 + break; + case DesktopLayer.SHELLDLL: + hDesktop = FindWindow("Progman", null);//第一层桌面 + hWnd = new HandleRef(window, hDesktop); + hDesktop = GetWindow(hWnd, GW_CHILD);//第2层桌面 + break; + case DesktopLayer.FolderView: + hDesktop = FindWindow("Progman", null);//第一层桌面 + hWnd = new HandleRef(window, hDesktop); + hDesktop = GetWindow(hWnd, GW_CHILD);//第2层桌面 + hWnd = new HandleRef(window, hDesktop); + hDesktop = GetWindow(hWnd, GW_CHILD);//第3层桌面 + break; + } + return hDesktop; + } + + public void EmbedDesktop(Object embeddedWindow, IntPtr childWindow, IntPtr parentWindow) + { + Form window = (Form)embeddedWindow; + HandleRef HWND_BOTTOM = new HandleRef(embeddedWindow, new IntPtr(1)); + const int SWP_FRAMECHANGED = 0x0020;//发送窗口大小改变消息 + SetParent(childWindow, parentWindow); + SetWindowPos(new HandleRef(window, childWindow), HWND_BOTTOM, 300, 300, window.Width, window.Height, SWP_FRAMECHANGED); + } + } + + public enum DesktopLayer + { + Progman = 0, + SHELLDLL = 1, + FolderView = 2 + } + + + + + + + +} diff --git a/ViewModel/AppConfig.cs b/ViewModel/AppConfig.cs index 29af1c9..61b62f4 100644 --- a/ViewModel/AppConfig.cs +++ b/ViewModel/AppConfig.cs @@ -107,6 +107,22 @@ namespace GeekDesk.ViewModel private bool? enableEveryThing; + private bool? alwaysTopmost; + + + public bool? AlwaysTopmost + { + get + { + if (alwaysTopmost == null) alwaysTopmost = false; + return alwaysTopmost; + } + set + { + alwaysTopmost = value; + OnPropertyChanged("AlwaysTopmost"); + } + } public bool? EnableEveryThing { From 37dd2f7fb20101ed796ea20d9fa11e430328c937 Mon Sep 17 00:00:00 2001 From: Demo_Liu Date: Mon, 3 Apr 2023 21:18:32 +0800 Subject: [PATCH 09/44] =?UTF-8?q?:bug:=20=20=E6=8E=A7=E5=88=B6=E4=B8=BB?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=83=AD=E9=94=AE=E8=B0=83=E7=94=A8=E9=A2=91?= =?UTF-8?q?=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/RunTimeStatus.cs | 8 ++++++++ Control/UserControls/ToDo/TodoControl.xaml | 7 ++++++- MainWindow.xaml.cs | 8 ++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Constant/RunTimeStatus.cs b/Constant/RunTimeStatus.cs index 0496be6..6df95ec 100644 --- a/Constant/RunTimeStatus.cs +++ b/Constant/RunTimeStatus.cs @@ -70,5 +70,13 @@ /// public static int EVERYTHING_SEARCH_DELAY_TIME = 300; + /// + /// 控制主界面热键按下规定时间内只执行一次show hide + /// + public static bool MAIN_HOT_KEY_DOWN = false; + /// + /// 控制主界面热键按下规定时间内只执行一次show hide + /// + public static int MAIN_HOT_KEY_TIME = 500; } } diff --git a/Control/UserControls/ToDo/TodoControl.xaml b/Control/UserControls/ToDo/TodoControl.xaml index 97fbd84..5bd02a1 100644 --- a/Control/UserControls/ToDo/TodoControl.xaml +++ b/Control/UserControls/ToDo/TodoControl.xaml @@ -82,10 +82,15 @@ - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 8b5327e..631ee10 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -374,6 +374,14 @@ namespace GeekDesk { hotKeyId = GlobalHotKey.RegisterHotKey(appData.AppConfig.HotkeyModifiers, appData.AppConfig.Hotkey, () => { + if (RunTimeStatus.MAIN_HOT_KEY_DOWN) return; + RunTimeStatus.MAIN_HOT_KEY_DOWN = true; + new Thread(() => + { + Thread.Sleep(RunTimeStatus.MAIN_HOT_KEY_TIME); + RunTimeStatus.MAIN_HOT_KEY_DOWN = false; + }).Start(); + if (MotionControl.hotkeyFinished) { if (CheckSholeShowApp()) From b12bbe9183e65051be1ca124385affd80685ab83 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Tue, 4 Apr 2023 13:33:36 +0800 Subject: [PATCH 10/44] =?UTF-8?q?:tada:=20=E4=B8=BB=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E7=BD=AE=E9=A1=B6=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.xaml.cs | 17 ++++------------- Util/WindowUtil.cs | 39 +++++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 631ee10..429a46b 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -257,16 +257,6 @@ namespace GeekDesk RightCard.VisibilitySearchCard(Visibility.Collapsed); SearchIconList.RemoveAll(); - - //App.DoEvents(); - //new Thread(() => - //{ - // this.Dispatcher.Invoke(() => - // { - - // }); - //}).Start(); - } @@ -350,6 +340,7 @@ namespace GeekDesk //毛玻璃 暂时未解决阴影问题 //BlurGlassUtil.EnableBlur(this); + //设置归属桌面 解决桌面覆盖程序界面的bug WindowUtil.SetOwner(this, WindowUtil.GetDesktopHandle(this, DesktopLayer.Progman)); if (appData.AppConfig.EnableEveryThing == true) @@ -384,7 +375,7 @@ namespace GeekDesk if (MotionControl.hotkeyFinished) { - if (CheckSholeShowApp()) + if (CheckShouldShowApp()) { ShowApp(); } @@ -707,7 +698,7 @@ namespace GeekDesk /// private void NotifyIcon_Click(object sender, RoutedEventArgs e) { - if (CheckSholeShowApp()) + if (CheckShouldShowApp()) { ShowApp(); } @@ -717,7 +708,7 @@ namespace GeekDesk } } - private static bool CheckSholeShowApp() + private static bool CheckShouldShowApp() { return mainWindow.Visibility == Visibility.Collapsed || mainWindow.Opacity == 0 diff --git a/Util/WindowUtil.cs b/Util/WindowUtil.cs index 0d224b2..880ebfe 100644 --- a/Util/WindowUtil.cs +++ b/Util/WindowUtil.cs @@ -60,12 +60,18 @@ namespace GeekDesk.Util private static extern bool SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, int x, int y, int cx, int cy, int flags); [DllImport("user32.dll")] private static extern int ReleaseDC(IntPtr window, IntPtr handle); + [DllImport("user32.dll")] + static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); - - public static void SetOwner(Window source, IntPtr parentHandle) + public static void SetOwner(Window window, Window parentWindow) { - WindowInteropHelper helper = new WindowInteropHelper(source); + SetOwner(window, new WindowInteropHelper(parentWindow).Handle); + } + + public static void SetOwner(Window window, IntPtr parentHandle) + { + WindowInteropHelper helper = new WindowInteropHelper(window); helper.Owner = parentHandle; } @@ -79,10 +85,21 @@ namespace GeekDesk.Util { IntPtr handle = new WindowInteropHelper(window).Handle; IntPtr deskHandle = GetDesktopHandle(window, DesktopLayer.Progman); - IntPtr deskHandle2 = GetDesktopHandle(window, DesktopLayer.FolderView); - IntPtr deskHandle3 = GetDesktopHandle(window, DesktopLayer.SHELLDLL); IntPtr topHandle = GetForegroundWindow(); - return (topHandle.Equals(handle) || topHandle.Equals(deskHandle)); + //暂时不能正确获取桌面handle 但发现焦点在桌面时 window title为空 + string windowTitle = GetWindowTitle(topHandle); + return topHandle.Equals(handle) || topHandle.Equals(deskHandle) || string.IsNullOrEmpty(windowTitle); + } + + private static string GetWindowTitle(IntPtr handle) + { + const int nChars = 256; + StringBuilder Buff = new StringBuilder(nChars); + if (GetWindowText(handle, Buff, nChars) > 0) + { + return Buff.ToString(); + } + return null; } @@ -110,19 +127,13 @@ namespace GeekDesk.Util hDesktop = GetWindow(hWnd, GW_CHILD);//第2层桌面 hWnd = new HandleRef(window, hDesktop); hDesktop = GetWindow(hWnd, GW_CHILD);//第3层桌面 + hWnd = new HandleRef(window, hDesktop); + hDesktop = GetWindow(hWnd, GW_CHILD);//第4层桌面 break; } return hDesktop; } - public void EmbedDesktop(Object embeddedWindow, IntPtr childWindow, IntPtr parentWindow) - { - Form window = (Form)embeddedWindow; - HandleRef HWND_BOTTOM = new HandleRef(embeddedWindow, new IntPtr(1)); - const int SWP_FRAMECHANGED = 0x0020;//发送窗口大小改变消息 - SetParent(childWindow, parentWindow); - SetWindowPos(new HandleRef(window, childWindow), HWND_BOTTOM, 300, 300, window.Width, window.Height, SWP_FRAMECHANGED); - } } public enum DesktopLayer From 3654ec393a9236897023db39179b9692ef13280b Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Tue, 4 Apr 2023 13:47:08 +0800 Subject: [PATCH 11/44] =?UTF-8?q?=E2=9C=85=20=E8=B0=83=E6=95=B4=E5=90=88?= =?UTF-8?q?=E9=80=82=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/PannelCard/RightCardControl.xaml | 8 ++++++-- Converts/GetWidthByWWConvert.cs | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml index f5ee134..d9ae435 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml +++ b/Control/UserControls/PannelCard/RightCardControl.xaml @@ -182,9 +182,13 @@ CanContentScroll="True" PreviewMouseWheel="IconListBox_MouseWheel" > - + - diff --git a/Converts/GetWidthByWWConvert.cs b/Converts/GetWidthByWWConvert.cs index ea893a6..56cd4ed 100644 --- a/Converts/GetWidthByWWConvert.cs +++ b/Converts/GetWidthByWWConvert.cs @@ -26,10 +26,10 @@ namespace GeekDesk.Converts return config.WindowWidth - config.MenuCardWidth; } else if (WidthTypeEnum.RIGHT_CARD_HALF == type) { - return (config.WindowWidth - config.MenuCardWidth) * 0.8; + return (config.WindowWidth - config.MenuCardWidth) * 0.618; } else if (WidthTypeEnum.RIGHT_CARD_HALF_TEXT == type) { - return (config.WindowWidth - config.MenuCardWidth) * 0.8 - config.ImageWidth - 20; + return (config.WindowWidth - config.MenuCardWidth) * 0.618 - config.ImageWidth - 20; } return config.WindowWidth; From 1fce566f4a83b3ba895c3c5d8e4017a37e440291 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Tue, 4 Apr 2023 17:59:06 +0800 Subject: [PATCH 12/44] =?UTF-8?q?EveryThing=E6=90=9C=E7=B4=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/RunTimeStatus.cs | 30 +- Control/Windows/ConfigWindow.xaml.cs | 3 +- GeekDesk.csproj | 6 + MainWindow.xaml.cs | 36 +- Plugins/EveryThing/32/Everything.ini | 740 +++++++++++++++++++++++++++ Plugins/EveryThing/64/Everything.ini | 740 +++++++++++++++++++++++++++ Plugins/EveryThing/EveryThingUtil.cs | 2 +- Util/FileUtil.cs | 12 +- 8 files changed, 1533 insertions(+), 36 deletions(-) create mode 100644 Plugins/EveryThing/32/Everything.ini create mode 100644 Plugins/EveryThing/64/Everything.ini diff --git a/Constant/RunTimeStatus.cs b/Constant/RunTimeStatus.cs index 6df95ec..521d42c 100644 --- a/Constant/RunTimeStatus.cs +++ b/Constant/RunTimeStatus.cs @@ -6,77 +6,77 @@ /// /// 查询框是否在工作 /// - public static bool SEARCH_BOX_SHOW = false; + public static volatile bool SEARCH_BOX_SHOW = false; /// /// 贴边隐藏后 以非鼠标经过方式触发显示 /// - public static bool MARGIN_HIDE_AND_OTHER_SHOW = false; + public static volatile bool MARGIN_HIDE_AND_OTHER_SHOW = false; /// /// 是否锁定主面板 锁定后 不执行隐藏动作 /// - public static bool LOCK_APP_PANEL = false; + public static volatile bool LOCK_APP_PANEL = false; /// /// 是否弹出了菜单密码框 /// - public static bool SHOW_MENU_PASSWORDBOX = false; + public static volatile bool SHOW_MENU_PASSWORDBOX = false; /// /// 是否弹出了右键菜单 /// - public static bool SHOW_RIGHT_BTN_MENU = false; + public static volatile bool SHOW_RIGHT_BTN_MENU = false; /// /// 是否点击了面板功能按钮 /// - public static bool APP_BTN_IS_DOWN = false; + public static volatile bool APP_BTN_IS_DOWN = false; /// /// 是否正在编辑菜单 /// - public static bool IS_MENU_EDIT = false; + public static volatile bool IS_MENU_EDIT = false; /// /// 图标card 鼠标滚轮是否正在工作 /// 用来控制popup的显示 否则低性能机器会造成卡顿 /// - public static bool ICONLIST_MOUSE_WHEEL = false; + public static volatile bool ICONLIST_MOUSE_WHEEL = false; /// /// 控制多少毫秒后 关闭(ICONLIST_MOUSE_WHEEL)鼠标滚轮运行状态 /// - public static int MOUSE_WHEEL_WAIT_MS = 100; + public static volatile int MOUSE_WHEEL_WAIT_MS = 100; /// /// 与关闭popup 配合使用, 避免线程结束后不显示popup /// - public static bool MOUSE_ENTER_ICON = false; + public static volatile bool MOUSE_ENTER_ICON = false; /// /// 控制每次刷新搜索结果 鼠标移动后显示popup /// - public static int MOUSE_MOVE_COUNT = 0; + public static volatile int MOUSE_MOVE_COUNT = 0; /// /// everything 新的键入搜索 /// - public static bool EVERYTHING_NEW_SEARCH = false; + public static volatile bool EVERYTHING_NEW_SEARCH = false; /// /// 键入多少毫秒后 没有新的键入开启搜索 /// - public static int EVERYTHING_SEARCH_DELAY_TIME = 300; + public static volatile int EVERYTHING_SEARCH_DELAY_TIME = 300; /// /// 控制主界面热键按下规定时间内只执行一次show hide /// - public static bool MAIN_HOT_KEY_DOWN = false; + public static volatile bool MAIN_HOT_KEY_DOWN = false; /// /// 控制主界面热键按下规定时间内只执行一次show hide /// - public static int MAIN_HOT_KEY_TIME = 500; + public static volatile int MAIN_HOT_KEY_TIME = 500; } } diff --git a/Control/Windows/ConfigWindow.xaml.cs b/Control/Windows/ConfigWindow.xaml.cs index 636d6c9..9d8c56c 100644 --- a/Control/Windows/ConfigWindow.xaml.cs +++ b/Control/Windows/ConfigWindow.xaml.cs @@ -1,5 +1,6 @@ using GeekDesk.Control.UserControls.Config; using GeekDesk.Interface; +using GeekDesk.Util; using GeekDesk.ViewModel; using HandyControl.Controls; using System.Collections.Generic; @@ -34,7 +35,7 @@ namespace GeekDesk.Control.Windows //BG.Source = ImageUtil.Base64ToBitmapImage(Constants.DEFAULT_BAC_IMAGE_BASE64); this.DataContext = appConfig; RightCard.Content = about; - this.Topmost = true; + WindowUtil.SetOwner(this, mainWindow); this.mainWindow = mainWindow; UFG.Visibility = Visibility.Collapsed; UFG.Visibility = Visibility.Visible; diff --git a/GeekDesk.csproj b/GeekDesk.csproj index cd73dbb..9379d17 100644 --- a/GeekDesk.csproj +++ b/GeekDesk.csproj @@ -486,9 +486,15 @@ + + Always + Always + + Always + Always diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 429a46b..b7ab8c4 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -128,7 +128,7 @@ namespace GeekDesk if (!RunTimeStatus.EVERYTHING_NEW_SEARCH) { RunTimeStatus.EVERYTHING_NEW_SEARCH = true; - SearchDelay(null, null); + SearchDelay(); } } else { @@ -143,7 +143,7 @@ namespace GeekDesk } - private void SearchDelay(object sender, EventArgs args) + private void SearchDelay() { new Thread(() => @@ -163,8 +163,7 @@ namespace GeekDesk { SearchIconList.RemoveAll(); } - //DelayHelper dh = sender as DelayHelper; - //string inpuText = dh.Source as string; + string inputText = SearchBox.Text.ToLower().Trim(); int count = 0; @@ -215,7 +214,7 @@ namespace GeekDesk this.Dispatcher.Invoke(() => { icon.BitmapImage_NoWrite = ImageUtil.GetBitmapIconByUnknownPath(icon.Path); - }); + }, DispatcherPriority.SystemIdle); } }).Start(); } @@ -245,18 +244,23 @@ namespace GeekDesk Thread.Sleep(1000); RunTimeStatus.EVERYTHING_NEW_SEARCH = false; }).Start(); + new Thread(() => + { + this.Dispatcher.Invoke(() => + { + Keyboard.Focus(SearchBox); + RunTimeStatus.SEARCH_BOX_SHOW = false; + SearchBox.TextChanged -= SearchBox_TextChanged; + SearchBox.Clear(); + SearchBox.TextChanged += SearchBox_TextChanged; + SearchBox.Width = 0; + TotalMsgBtn.Content = "0 of 0"; + TotalMsgBtn.Visibility = Visibility.Hidden; + RightCard.VisibilitySearchCard(Visibility.Collapsed); - Keyboard.Focus(SearchBox); - RunTimeStatus.SEARCH_BOX_SHOW = false; - SearchBox.TextChanged -= SearchBox_TextChanged; - SearchBox.Clear(); - SearchBox.TextChanged += SearchBox_TextChanged; - SearchBox.Width = 0; - TotalMsgBtn.Content = "0 of 0"; - TotalMsgBtn.Visibility = Visibility.Hidden; - RightCard.VisibilitySearchCard(Visibility.Collapsed); - - SearchIconList.RemoveAll(); + SearchIconList.RemoveAll(); + }); + }).Start(); } diff --git a/Plugins/EveryThing/32/Everything.ini b/Plugins/EveryThing/32/Everything.ini new file mode 100644 index 0000000..143657e --- /dev/null +++ b/Plugins/EveryThing/32/Everything.ini @@ -0,0 +1,740 @@ +; Please make sure Everything is not running before modifying this file. +[Everything] +run_as_admin=0 +allow_http_server=1 +allow_etp_server=1 +window_x=130 +window_y=130 +window_wide=794 +window_high=664 +maximized=0 +minimized=0 +fullscreen=0 +ontop=0 +bring_into_view=1 +alpha=255 +match_whole_word=0 +match_path=0 +match_case=0 +match_diacritics=0 +match_regex=0 +view=0 +thumbnail_size=64 +thumbnail_fill=0 +min_thumbnail_size=32 +max_thumbnail_size=256 +medium_thumbnail_size=64 +large_thumbnail_size=128 +extra_large_thumbnail_size=256 +thumbnail_load_size=0 +thumbnail_overlay_icon=1 +shell_max_path=0 +allow_multiple_windows=0 +allow_multiple_instances=0 +run_in_background=1 +show_in_taskbar=1 +show_tray_icon=0 +minimize_to_tray=0 +toggle_window_from_tray_icon=0 +alternate_row_color=0 +show_mouseover=0 +check_for_updates_on_startup=0 +beta_updates=0 +show_highlighted_search_terms=1 +text_size=0 +hide_empty_search_results=0 +clear_selection_on_search=1 +show_focus_on_search=0 +new_window_key=0 +show_window_key=0 +toggle_window_key=0 +language=0 +show_selected_item_in_statusbar=1 +statusbar_selected_item_format= +show_size_in_statusbar=0 +statusbar_size_format=0 +open_folder_command2= +open_file_command2= +open_path_command2= +explore_command2= +explore_path_command2= +window_title_format= +taskbar_notification_title_format= +instance_name= +translucent_selection_rectangle_alpha=70 +min_zoom=-6 +max_zoom=27 +context_menu_type=0 +context_menu_shell_extensions=1 +auto_include_fixed_volumes=1 +auto_include_removable_volumes=0 +auto_remove_offline_ntfs_volumes=1 +auto_remove_moved_ntfs_volumes=1 +auto_include_fixed_refs_volumes=1 +auto_include_removable_refs_volumes=0 +auto_remove_offline_refs_volumes=1 +auto_remove_moved_refs_volumes=1 +find_mount_points_on_removable_volumes=0 +scan_volume_drive_letters=1 +last_export_type=0 +max_threads=0 +reuse_threads=1 +find_subfolders_and_files_max_threads=0 +single_parent_context_menu=0 +auto_size_1=512 +auto_size_2=640 +auto_size_3=768 +auto_size_aspect_ratio_x=9 +auto_size_aspect_ratio_y=7 +auto_size_width_only=0 +auto_size_path_x=1 +auto_size_path_y=2 +sticky_vscroll_bottom=1 +last_options_page=0 +draw_focus_rect=1 +date_format= +time_format= +listview_item_high=0 +single_click_open=0 +underline_icon_titles=0 +icons_only=0 +icon_shell_extensions=1 +auto_scroll_repeat_delay=250 +auto_scroll_repeat_rate=50 +open_many_files_warning_threshold=16 +set_foreground_window_attach_thread_input=0 +debug=0 +debug_log=0 +verbose=0 +lvm=1 +ipc=1 +home_match_case=0 +home_match_whole_word=0 +home_match_path=0 +home_match_diacritics=0 +home_regex=0 +home_search=1 +home_filter=0 +home_sort=0 +home_view=0 +home_index=1 +allow_multiple_windows_from_tray=0 +single_click_tray=0 +close_on_execute=0 +double_click_path=0 +update_display_after_scroll=0 +update_display_after_mask=1 +auto_scroll_view=0 +double_quote_copy_as_path=0 +snap=0 +snaplen=10 +rename_select_filepart_only=0 +rename_move_caret_to_selection_end=0 +rename_nav=0 +search_edit_move_caret_to_selection_end=0 +search_edit_drag_accept_files=0 +select_search_on_mouse_click=1 +focus_search_on_activate=0 +reset_vscroll_on_search=1 +wrap_focus=0 +load_icon_priority=0 +load_thumbnail_priority=0 +load_fileinfo_priority=0 +always_request_all_fileinfo=0 +header_high=0 +hide_on_close=0 +max_hidden_windows=0 +winmm=0 +menu_escape_amp=1 +menu_folders=0 +menu_folder_separator= +menu_items_per_column=0 +new_inherit=1 +full_row_select=0 +tray_show_command_line= +dpi=96 +ctrl_mouse_wheel_action=1 +lvm_scroll=1 +allow_open=1 +allow_context_menu=1 +allow_delete=1 +allow_rename=1 +allow_cut=1 +allow_copy=1 +allow_paste=1 +allow_drag_drop=1 +allow_window_message_filter_dragdrop=0 +auto_column_widths=0 +hotkey_explorer_path_search=0 +hotkey_user_notification_state=0 +get_key_name_text=1 +paste_new_line_op=0 +esc_cancel_action=1 +fast_ascii_search=1 +match_path_when_search_contains_path_separator=1 +allow_literal_operators=0 +allow_round_bracket_parenthesis=0 +expand_environment_variables=0 +search_as_you_type=1 +always_update_query_on_search_parameter_change=0 +convert_forward_slash_to_backslash=0 +match_whole_filename_when_using_wildcards=1 +operator_precedence=0 +replace_exact_trailing_star_dot_star_with_star=1 +allow_exclamation_point_not=1 +search_command_prefix= +auto_complete_search_command=1 +double_buffer=1 +search= +show_number_of_results_with_selection=0 +date_descending_first=0 +size_descending_first=0 +size_format=2 +alpha_select=0 +tooltips=1 +listview_tooltips=1 +show_detailed_listview_tooltips=1 +rtl_listview_edit=0 +force_path_ltr_order=1 +force_path_left_align=1 +date_time_order=0 +date_time_align=1 +size_align=3 +invert_layout=0 +update_layout_on_input_language_change=0 +control_shift_action=3 +change_search_rtl_reading_action=3 +invert_layout_action=3 +bookmark_remember_case=1 +bookmark_remember_wholeword=1 +bookmark_remember_path=1 +bookmark_remember_diacritic=1 +bookmark_remember_regex=1 +bookmark_remember_sort=1 +bookmark_remember_view=1 +bookmark_remember_filter=1 +bookmark_remember_index=1 +bookmark_remember_search=1 +bookmark_organize_x=0 +bookmark_organize_y=0 +bookmark_organize_wide=0 +bookmark_organize_high=0 +exclude_list_enabled=1 +exclude_hidden_files_and_folders=0 +exclude_system_files_and_folders=0 +include_only_files= +exclude_files= +db_location= +db_multi_user_filename=0 +db_compress=0 +index_size=1 +fast_size_sort=1 +index_date_created=0 +fast_date_created_sort=0 +index_date_modified=1 +fast_date_modified_sort=1 +index_date_accessed=0 +fast_date_accessed_sort=0 +index_attributes=0 +fast_attributes_sort=0 +index_folder_size=0 +fast_path_sort=1 +fast_extension_sort=0 +extended_information_cache_monitor=1 +db_update_thread_priority=-15 +index_recent_changes=1 +refs_file_id_extd_directory_info_buffer_size=0 +folder_update_thread_mode_background=0 +folder_update_rescan_asap=1 +monitor_thread_mode_background=1 +monitor_retry_delay=30000 +monitor_update_delay=1000 +monitor_pause=0 +usn_record_filter=0xffffffff +cancel_delay=0x000003e8 +allow_ntfs_open_file_by_id=1 +always_update_folder_recent_change=0 +editor_x=0 +editor_y=0 +editor_wide=0 +editor_high=0 +editor_maximized=0 +file_list_relative_paths=0 +rename_x=0 +rename_y=0 +rename_wide=0 +rename_high=0 +rename_match_case=0 +rename_regex=0 +advanced_copy_to_x=0 +advanced_copy_to_y=0 +advanced_copy_to_wide=0 +advanced_copy_to_high=0 +advanced_copy_to_match_case=0 +advanced_copy_to_regex=0 +advanced_move_to_x=0 +advanced_move_to_y=0 +advanced_move_to_wide=0 +advanced_move_to_high=0 +advanced_move_to_match_case=0 +advanced_move_to_regex=0 +advanced_search_x=0 +advanced_search_y=0 +advanced_search_wide=0 +advanced_search_high=0 +advanced_search_page_y_offset=0 +advanced_search_focus_id=0 +advanced_search_warnings=1 +max_recv_size=8388608 +display_full_path_name=0 +size_tiny=10240 +size_small=102400 +size_medium=1048576 +size_large=16777216 +size_huge=134217728 +themed_toolbar=1 +show_copy_name=2 +show_copy_path=2 +show_copy_full_name=2 +show_open_path=2 +show_explore=2 +show_explore_path=2 +copy_path_folder_append_backslash=0 +custom_verb01= +custom_verb02= +custom_verb03= +custom_verb04= +custom_verb05= +custom_verb06= +custom_verb07= +custom_verb08= +custom_verb09= +custom_verb10= +custom_verb11= +custom_verb12= +filters_visible=0 +filters_wide=128 +filters_right_align=1 +filters_tab_stop=0 +filter= +filter_everything_name= +filter_organize_x=0 +filter_organize_y=0 +filter_organize_wide=0 +filter_organize_high=0 +preview_visible=0 +preview_x=640 +preview_tab_stop=0 +preview_mag_filter=0 +preview_min_filter=0 +preview_fill=0 +show_preview_handlers_in_preview_pane=0 +preview_load_size=0 +preview_context=0x00000000 +preview_release_handler_on_clear=0 +sort=Run Count +sort_ascending=0 +always_keep_sort=0 +index=0 +index_file_list= +index_etp_server= +index_link_type=1 +status_bar_visible=1 +select_search_on_focus_mode=1 +select_search_on_set_mode=2 +search_history_enabled=0 +run_history_enabled=1 +search_history_days_to_keep=90 +run_history_days_to_keep=90 +search_history_keep_forever=1 +run_history_keep_forever=1 +search_history_always_suggest=0 +search_history_always_suggest_extend_toolbar=0 +search_history_visible_count_max=12 +search_history_always_suggest_visible_count_max=1 +search_history_show_all_max=256 +search_history_suggestion_max=256 +search_history_show_all_sort=2 +search_history_suggestion_sort=1 +search_history_show_above=0 +search_history_sort=2 +search_history_sort_ascending=0 +search_history_x=0 +search_history_y=0 +search_history_wide=0 +search_history_high=0 +search_history_column_search_wide=208 +search_history_column_search_order=0 +search_history_column_count_wide=128 +search_history_column_count_order=1 +search_history_column_date_wide=128 +search_history_column_date_order=2 +etp_server_enabled=0 +etp_server_bindings= +etp_server_port=21 +etp_server_username= +etp_server_password= +etp_server_welcome_message= +etp_server_log_file_name= +etp_server_logging_enabled=0 +etp_server_log_max_size=4194304 +etp_server_log_delta_size=524288 +etp_server_allow_file_download=1 +ftp_allow_port=1 +ftp_check_data_connection_ip=1 +http_server_enabled=0 +http_server_bindings= +http_title_format= +http_server_port=80 +http_server_username= +http_server_password= +http_server_home= +http_server_default_page= +http_server_log_file_name= +http_server_logging_enabled=0 +http_server_log_max_size=4194304 +http_server_log_delta_size=524288 +http_server_allow_file_download=1 +http_server_items_per_page=32 +http_server_show_drive_labels=0 +http_server_strings= +http_server_header= +service_pipe_name= +name_column_pos=0 +name_column_width=256 +path_column_visible=1 +path_column_pos=1 +path_column_width=256 +size_column_visible=1 +size_column_pos=2 +size_column_width=96 +extension_column_visible=0 +extension_column_pos=3 +extension_column_width=96 +type_column_visible=0 +type_column_pos=4 +type_column_width=96 +last_write_time_column_visible=1 +last_write_time_column_pos=3 +last_write_time_column_width=153 +creation_time_column_visible=0 +creation_time_column_pos=6 +creation_time_column_width=153 +date_accessed_column_visible=0 +date_accessed_column_pos=7 +date_accessed_column_width=153 +attribute_column_visible=0 +attribute_column_pos=8 +attribute_column_width=70 +date_recently_changed_column_visible=0 +date_recently_changed_column_pos=9 +date_recently_changed_column_width=153 +run_count_column_visible=0 +run_count_column_pos=10 +run_count_column_width=96 +date_run_column_visible=0 +date_run_column_pos=11 +date_run_column_width=153 +file_list_filename_column_visible=0 +file_list_filename_column_pos=12 +file_list_filename_column_width=96 +translucent_selection_rectangle_background_color= +translucent_selection_rectangle_border_color= +thumbnail_mouseover_border_color= +preview_background_color= +ntfs_volume_guids="\\\\?\\Volume{6afe1915-0a0b-4e59-96bc-666ff914ea4f}","\\\\?\\Volume{71be44cf-e03a-462f-a9c8-b53c16e002a4}" +ntfs_volume_paths="C:","D:" +ntfs_volume_roots="","" +ntfs_volume_includes=1,1 +ntfs_volume_load_recent_changes=0,0 +ntfs_volume_include_onlys="","" +ntfs_volume_monitors=1,1 +refs_volume_guids= +refs_volume_paths= +refs_volume_roots= +refs_volume_includes= +refs_volume_load_recent_changes= +refs_volume_include_onlys= +refs_volume_monitors= +filelists= +filelist_monitor_changes= +folders= +folder_monitor_changes= +folder_buffer_size_list= +folder_rescan_if_full_list= +folder_update_types= +folder_update_days= +folder_update_ats= +folder_update_intervals= +folder_update_interval_types= +exclude_folders= +connect_history_hosts= +connect_history_ports= +connect_history_usernames= +connect_history_link_types= +etp_client_rewrite_patterns= +etp_client_rewrite_substitutions= +file_new_search_window_keys=334 +file_open_file_list_keys=335 +file_close_file_list_keys= +file_close_keys=343,27 +file_export_keys=339 +file_copy_full_name_to_clipboard_keys=9539 +file_copy_path_to_clipboard_keys= +file_set_run_count_keys= +file_create_shortcut_keys= +file_delete_keys=8238 +file_delete_permanently_keys=9262 +file_edit_keys= +file_open_keys=8205 +file_open_selection_and_close_everything_keys= +file_explore_path_keys= +file_open_new_keys= +file_open_path_keys=8461 +file_open_with_keys= +file_open_with_default_verb_keys= +file_play_keys= +file_preview_keys= +file_print_keys= +file_print_to_keys= +file_properties_keys=8717 +file_read_extended_information_keys=8517 +file_rename_keys=8305 +file_run_as_keys= +file_exit_keys=337 +file_copy_name_to_clipboard_keys= +file_open_selection_and_do_not_close_everything_keys= +file_open_most_run_keys= +file_open_last_run_keys= +file_custom_verb_1_keys= +file_custom_verb_2_keys= +file_custom_verb_3_keys= +file_custom_verb_4_keys= +file_custom_verb_5_keys= +file_custom_verb_6_keys= +file_custom_verb_7_keys= +file_custom_verb_8_keys= +file_custom_verb_9_keys= +file_custom_verb_10_keys= +file_custom_verb_11_keys= +file_custom_verb_12_keys= +indexes_folders_rescan_all_now_keys= +indexes_force_rebuild_keys= +edit_cut_keys=8536 +edit_copy_keys=8515,8493 +edit_paste_keys=8534,9261 +edit_select_all_keys=8513 +edit_invert_selection_keys= +edit_copy_to_folder_keys= +edit_move_to_folder_keys= +edit_advanced_advanced_copy_to_folder_keys= +edit_advanced_advanced_move_to_folder_keys= +view_filters_keys= +view_preview_keys=592 +view_status_bar_keys= +view_details_keys=1334 +view_medium_thumbnails_keys=1331 +view_large_thumbnails_keys=1330 +view_extra_large_thumbnails_keys=1329 +view_increase_thumbnail_size_keys=1467 +view_decrease_thumbnail_size_keys=1469 +view_window_size_small_keys=561 +view_window_size_medium_keys=562 +view_window_size_large_keys=563 +view_window_size_auto_fit_keys=564 +view_zoom_zoom_in_keys=443 +view_zoom_zoom_out_keys=445 +view_zoom_reset_keys=304,352 +view_go_to_back_keys=549,166 +view_go_to_forward_keys=551,167 +view_go_to_home_keys=548 +view_go_to_show_all_history_keys=1352,328 +view_sort_by_name_keys=305 +view_sort_by_path_keys=306 +view_sort_by_size_keys=307 +view_sort_by_extension_keys=308 +view_sort_by_type_keys=309 +view_sort_by_date_modified_keys=310 +view_sort_by_date_created_keys=311 +view_sort_by_attributes_keys=312 +view_sort_by_file_list_filename_keys= +view_sort_by_run_count_keys= +view_sort_by_date_run_keys= +view_sort_by_date_recently_changed_keys=313 +view_sort_by_date_accessed_keys= +view_sort_by_ascending_keys= +view_sort_by_descending_keys= +view_refresh_keys=116 +view_fullscreen_keys=122 +view_toggle_ltrrtl_direction_keys= +view_on_top_never_keys= +view_on_top_always_keys= +view_on_top_while_searching_keys= +search_match_case_keys=329 +search_match_whole_word_keys=322 +search_match_path_keys=341 +search_match_diacritics_keys=333 +search_enable_regex_keys=338 +search_advanced_search_keys= +search_add_to_filters_keys= +search_organize_filters_keys=1350 +bookmarks_add_to_bookmarks_keys=324 +bookmarks_organize_bookmarks_keys=1346 +tools_options_keys=336 +tools_console_keys=448 +tools_file_list_editor_keys= +tools_connect_to_etp_server_keys= +tools_disconnect_from_etp_server_keys= +help_everything_help_keys=112 +help_search_syntax_keys= +help_regex_syntax_keys= +help_command_line_options_keys= +help_everything_website_keys= +help_check_for_updates_keys= +help_about_everything_keys=368 +help_donate_keys= +search_edit_focus_search_edit_keys=326,114,580 +search_edit_delete_previous_word_keys=4360 +search_edit_auto_complete_search_keys=4384 +search_edit_show_search_history_keys= +search_edit_show_all_search_history_keys=4646,4648 +result_list_item_up_keys=8230,4134 +result_list_item_down_keys=8232,4136 +result_list_page_up_keys=8225,4129 +result_list_page_down_keys=8226,4130 +result_list_start_of_list_keys=8228 +result_list_end_of_list_keys=8227 +result_list_item_up_extend_keys=9254,5158 +result_list_item_down_extend_keys=9256,5160 +result_list_page_up_extend_keys=9249,5153 +result_list_page_down_extend_keys=9250,5154 +result_list_start_of_list_extend_keys=9252 +result_list_end_of_list_extend_keys=9251 +result_list_focus_up_keys=8486,4390 +result_list_focus_down_keys=8488,4392 +result_list_focus_page_up_keys=8481,4385 +result_list_focus_page_down_keys=8482,4386 +result_list_focus_start_of_list_keys=8484 +result_list_focus_end_of_list_keys=8483 +result_list_focus_up_extend_keys=9510,5414 +result_list_focus_down_extend_keys=9512,5416 +result_list_focus_page_up_extend_keys=9505,5409 +result_list_focus_page_down_extend_keys=9506,5410 +result_list_focus_start_of_list_extend_keys=9508 +result_list_focus_end_of_list_extend_keys=9507 +result_list_focus_result_list_keys= +result_list_focus_highest_run_count_result_keys= +result_list_focus_last_run_result_keys= +result_list_toggle_path_column_keys= +result_list_toggle_size_column_keys= +result_list_toggle_extension_column_keys= +result_list_toggle_type_column_keys= +result_list_toggle_date_modified_column_keys= +result_list_toggle_date_created_column_keys= +result_list_toggle_attributes_column_keys= +result_list_toggle_file_list_filename_column_keys= +result_list_toggle_run_count_column_keys= +result_list_toggle_date_recently_changed_column_keys= +result_list_toggle_date_accessed_column_keys= +result_list_toggle_date_run_column_keys= +result_list_size_all_columns_to_fit_keys=8555 +result_list_size_result_list_to_fit_keys= +result_list_context_menu_keys=9337 +result_list_scroll_left_or_thumbnail_left_keys=8229 +result_list_scroll_right_or_thumbnail_right_keys=8231 +result_list_scroll_page_left_or_thumbnail_focus_left_keys=8485 +result_list_scroll_page_right_or_thumbnail_focus_right_keys=8487 +result_list_left_extend_keys=9253 +result_list_right_extend_keys=9255 +result_list_focus_left_extend_keys=9509 +result_list_focus_right_extend_keys=9511 +result_list_select_focus_keys=8224 +result_list_toggle_focus_selection_keys=8480 +result_list_copy_as_csv_keys= +preview_focus_preview_keys= +result_list_font= +result_list_font_size= +search_edit_font= +search_edit_font_size= +status_bar_font= +status_bar_font_size= +header_font= +header_font_size= +normal_background_color= +normal_foreground_color= +normal_bold= +highlighted_background_color= +highlighted_foreground_color= +highlighted_bold= +current_sort_background_color= +current_sort_foreground_color= +current_sort_bold= +current_sort_highlighted_background_color= +current_sort_highlighted_foreground_color= +current_sort_highlighted_bold= +selected_background_color= +selected_foreground_color= +selected_bold= +selected_highlighted_background_color= +selected_highlighted_foreground_color= +selected_highlighted_bold= +selected_inactive_background_color= +selected_inactive_foreground_color= +selected_inactive_bold= +selected_inactive_highlighted_background_color= +selected_inactive_highlighted_foreground_color= +selected_inactive_highlighted_bold= +drop_target_background_color= +drop_target_foreground_color= +drop_target_bold= +drop_target_highlighted_background_color= +drop_target_highlighted_foreground_color= +drop_target_highlighted_bold= +mouseover_background_color= +mouseover_foreground_color= +mouseover_bold= +mouseover_highlighted_background_color= +mouseover_highlighted_foreground_color= +mouseover_highlighted_bold= +mouseover_current_sort_background_color= +mouseover_current_sort_foreground_color= +mouseover_current_sort_bold= +mouseover_current_sort_highlighted_background_color= +mouseover_current_sort_highlighted_foreground_color= +mouseover_current_sort_highlighted_bold= +alternate_row_background_color= +alternate_row_foreground_color= +alternate_row_bold= +alternate_row_highlighted_background_color= +alternate_row_highlighted_foreground_color= +alternate_row_highlighted_bold= +current_sort_alternate_row_background_color= +current_sort_alternate_row_foreground_color= +current_sort_alternate_row_bold= +current_sort_alternate_row_highlighted_background_color= +current_sort_alternate_row_highlighted_foreground_color= +current_sort_alternate_row_highlighted_bold= +hot_background_color= +hot_foreground_color= +hot_bold= +hot_highlighted_background_color= +hot_highlighted_foreground_color= +hot_highlighted_bold= +selected_hot_background_color= +selected_hot_foreground_color= +selected_hot_bold= +selected_hot_highlighted_background_color= +selected_hot_highlighted_foreground_color= +selected_hot_highlighted_bold= +selected_inactive_hot_background_color= +selected_inactive_hot_foreground_color= +selected_inactive_hot_bold= +selected_inactive_hot_highlighted_background_color= +selected_inactive_hot_highlighted_foreground_color= +selected_inactive_hot_highlighted_bold= +thumbnail_mouseover_background_color= +thumbnail_mouseover_foreground_color= +thumbnail_mouseover_bold= +thumbnail_mouseover_highlighted_background_color= +thumbnail_mouseover_highlighted_foreground_color= +thumbnail_mouseover_highlighted_bold= diff --git a/Plugins/EveryThing/64/Everything.ini b/Plugins/EveryThing/64/Everything.ini new file mode 100644 index 0000000..143657e --- /dev/null +++ b/Plugins/EveryThing/64/Everything.ini @@ -0,0 +1,740 @@ +; Please make sure Everything is not running before modifying this file. +[Everything] +run_as_admin=0 +allow_http_server=1 +allow_etp_server=1 +window_x=130 +window_y=130 +window_wide=794 +window_high=664 +maximized=0 +minimized=0 +fullscreen=0 +ontop=0 +bring_into_view=1 +alpha=255 +match_whole_word=0 +match_path=0 +match_case=0 +match_diacritics=0 +match_regex=0 +view=0 +thumbnail_size=64 +thumbnail_fill=0 +min_thumbnail_size=32 +max_thumbnail_size=256 +medium_thumbnail_size=64 +large_thumbnail_size=128 +extra_large_thumbnail_size=256 +thumbnail_load_size=0 +thumbnail_overlay_icon=1 +shell_max_path=0 +allow_multiple_windows=0 +allow_multiple_instances=0 +run_in_background=1 +show_in_taskbar=1 +show_tray_icon=0 +minimize_to_tray=0 +toggle_window_from_tray_icon=0 +alternate_row_color=0 +show_mouseover=0 +check_for_updates_on_startup=0 +beta_updates=0 +show_highlighted_search_terms=1 +text_size=0 +hide_empty_search_results=0 +clear_selection_on_search=1 +show_focus_on_search=0 +new_window_key=0 +show_window_key=0 +toggle_window_key=0 +language=0 +show_selected_item_in_statusbar=1 +statusbar_selected_item_format= +show_size_in_statusbar=0 +statusbar_size_format=0 +open_folder_command2= +open_file_command2= +open_path_command2= +explore_command2= +explore_path_command2= +window_title_format= +taskbar_notification_title_format= +instance_name= +translucent_selection_rectangle_alpha=70 +min_zoom=-6 +max_zoom=27 +context_menu_type=0 +context_menu_shell_extensions=1 +auto_include_fixed_volumes=1 +auto_include_removable_volumes=0 +auto_remove_offline_ntfs_volumes=1 +auto_remove_moved_ntfs_volumes=1 +auto_include_fixed_refs_volumes=1 +auto_include_removable_refs_volumes=0 +auto_remove_offline_refs_volumes=1 +auto_remove_moved_refs_volumes=1 +find_mount_points_on_removable_volumes=0 +scan_volume_drive_letters=1 +last_export_type=0 +max_threads=0 +reuse_threads=1 +find_subfolders_and_files_max_threads=0 +single_parent_context_menu=0 +auto_size_1=512 +auto_size_2=640 +auto_size_3=768 +auto_size_aspect_ratio_x=9 +auto_size_aspect_ratio_y=7 +auto_size_width_only=0 +auto_size_path_x=1 +auto_size_path_y=2 +sticky_vscroll_bottom=1 +last_options_page=0 +draw_focus_rect=1 +date_format= +time_format= +listview_item_high=0 +single_click_open=0 +underline_icon_titles=0 +icons_only=0 +icon_shell_extensions=1 +auto_scroll_repeat_delay=250 +auto_scroll_repeat_rate=50 +open_many_files_warning_threshold=16 +set_foreground_window_attach_thread_input=0 +debug=0 +debug_log=0 +verbose=0 +lvm=1 +ipc=1 +home_match_case=0 +home_match_whole_word=0 +home_match_path=0 +home_match_diacritics=0 +home_regex=0 +home_search=1 +home_filter=0 +home_sort=0 +home_view=0 +home_index=1 +allow_multiple_windows_from_tray=0 +single_click_tray=0 +close_on_execute=0 +double_click_path=0 +update_display_after_scroll=0 +update_display_after_mask=1 +auto_scroll_view=0 +double_quote_copy_as_path=0 +snap=0 +snaplen=10 +rename_select_filepart_only=0 +rename_move_caret_to_selection_end=0 +rename_nav=0 +search_edit_move_caret_to_selection_end=0 +search_edit_drag_accept_files=0 +select_search_on_mouse_click=1 +focus_search_on_activate=0 +reset_vscroll_on_search=1 +wrap_focus=0 +load_icon_priority=0 +load_thumbnail_priority=0 +load_fileinfo_priority=0 +always_request_all_fileinfo=0 +header_high=0 +hide_on_close=0 +max_hidden_windows=0 +winmm=0 +menu_escape_amp=1 +menu_folders=0 +menu_folder_separator= +menu_items_per_column=0 +new_inherit=1 +full_row_select=0 +tray_show_command_line= +dpi=96 +ctrl_mouse_wheel_action=1 +lvm_scroll=1 +allow_open=1 +allow_context_menu=1 +allow_delete=1 +allow_rename=1 +allow_cut=1 +allow_copy=1 +allow_paste=1 +allow_drag_drop=1 +allow_window_message_filter_dragdrop=0 +auto_column_widths=0 +hotkey_explorer_path_search=0 +hotkey_user_notification_state=0 +get_key_name_text=1 +paste_new_line_op=0 +esc_cancel_action=1 +fast_ascii_search=1 +match_path_when_search_contains_path_separator=1 +allow_literal_operators=0 +allow_round_bracket_parenthesis=0 +expand_environment_variables=0 +search_as_you_type=1 +always_update_query_on_search_parameter_change=0 +convert_forward_slash_to_backslash=0 +match_whole_filename_when_using_wildcards=1 +operator_precedence=0 +replace_exact_trailing_star_dot_star_with_star=1 +allow_exclamation_point_not=1 +search_command_prefix= +auto_complete_search_command=1 +double_buffer=1 +search= +show_number_of_results_with_selection=0 +date_descending_first=0 +size_descending_first=0 +size_format=2 +alpha_select=0 +tooltips=1 +listview_tooltips=1 +show_detailed_listview_tooltips=1 +rtl_listview_edit=0 +force_path_ltr_order=1 +force_path_left_align=1 +date_time_order=0 +date_time_align=1 +size_align=3 +invert_layout=0 +update_layout_on_input_language_change=0 +control_shift_action=3 +change_search_rtl_reading_action=3 +invert_layout_action=3 +bookmark_remember_case=1 +bookmark_remember_wholeword=1 +bookmark_remember_path=1 +bookmark_remember_diacritic=1 +bookmark_remember_regex=1 +bookmark_remember_sort=1 +bookmark_remember_view=1 +bookmark_remember_filter=1 +bookmark_remember_index=1 +bookmark_remember_search=1 +bookmark_organize_x=0 +bookmark_organize_y=0 +bookmark_organize_wide=0 +bookmark_organize_high=0 +exclude_list_enabled=1 +exclude_hidden_files_and_folders=0 +exclude_system_files_and_folders=0 +include_only_files= +exclude_files= +db_location= +db_multi_user_filename=0 +db_compress=0 +index_size=1 +fast_size_sort=1 +index_date_created=0 +fast_date_created_sort=0 +index_date_modified=1 +fast_date_modified_sort=1 +index_date_accessed=0 +fast_date_accessed_sort=0 +index_attributes=0 +fast_attributes_sort=0 +index_folder_size=0 +fast_path_sort=1 +fast_extension_sort=0 +extended_information_cache_monitor=1 +db_update_thread_priority=-15 +index_recent_changes=1 +refs_file_id_extd_directory_info_buffer_size=0 +folder_update_thread_mode_background=0 +folder_update_rescan_asap=1 +monitor_thread_mode_background=1 +monitor_retry_delay=30000 +monitor_update_delay=1000 +monitor_pause=0 +usn_record_filter=0xffffffff +cancel_delay=0x000003e8 +allow_ntfs_open_file_by_id=1 +always_update_folder_recent_change=0 +editor_x=0 +editor_y=0 +editor_wide=0 +editor_high=0 +editor_maximized=0 +file_list_relative_paths=0 +rename_x=0 +rename_y=0 +rename_wide=0 +rename_high=0 +rename_match_case=0 +rename_regex=0 +advanced_copy_to_x=0 +advanced_copy_to_y=0 +advanced_copy_to_wide=0 +advanced_copy_to_high=0 +advanced_copy_to_match_case=0 +advanced_copy_to_regex=0 +advanced_move_to_x=0 +advanced_move_to_y=0 +advanced_move_to_wide=0 +advanced_move_to_high=0 +advanced_move_to_match_case=0 +advanced_move_to_regex=0 +advanced_search_x=0 +advanced_search_y=0 +advanced_search_wide=0 +advanced_search_high=0 +advanced_search_page_y_offset=0 +advanced_search_focus_id=0 +advanced_search_warnings=1 +max_recv_size=8388608 +display_full_path_name=0 +size_tiny=10240 +size_small=102400 +size_medium=1048576 +size_large=16777216 +size_huge=134217728 +themed_toolbar=1 +show_copy_name=2 +show_copy_path=2 +show_copy_full_name=2 +show_open_path=2 +show_explore=2 +show_explore_path=2 +copy_path_folder_append_backslash=0 +custom_verb01= +custom_verb02= +custom_verb03= +custom_verb04= +custom_verb05= +custom_verb06= +custom_verb07= +custom_verb08= +custom_verb09= +custom_verb10= +custom_verb11= +custom_verb12= +filters_visible=0 +filters_wide=128 +filters_right_align=1 +filters_tab_stop=0 +filter= +filter_everything_name= +filter_organize_x=0 +filter_organize_y=0 +filter_organize_wide=0 +filter_organize_high=0 +preview_visible=0 +preview_x=640 +preview_tab_stop=0 +preview_mag_filter=0 +preview_min_filter=0 +preview_fill=0 +show_preview_handlers_in_preview_pane=0 +preview_load_size=0 +preview_context=0x00000000 +preview_release_handler_on_clear=0 +sort=Run Count +sort_ascending=0 +always_keep_sort=0 +index=0 +index_file_list= +index_etp_server= +index_link_type=1 +status_bar_visible=1 +select_search_on_focus_mode=1 +select_search_on_set_mode=2 +search_history_enabled=0 +run_history_enabled=1 +search_history_days_to_keep=90 +run_history_days_to_keep=90 +search_history_keep_forever=1 +run_history_keep_forever=1 +search_history_always_suggest=0 +search_history_always_suggest_extend_toolbar=0 +search_history_visible_count_max=12 +search_history_always_suggest_visible_count_max=1 +search_history_show_all_max=256 +search_history_suggestion_max=256 +search_history_show_all_sort=2 +search_history_suggestion_sort=1 +search_history_show_above=0 +search_history_sort=2 +search_history_sort_ascending=0 +search_history_x=0 +search_history_y=0 +search_history_wide=0 +search_history_high=0 +search_history_column_search_wide=208 +search_history_column_search_order=0 +search_history_column_count_wide=128 +search_history_column_count_order=1 +search_history_column_date_wide=128 +search_history_column_date_order=2 +etp_server_enabled=0 +etp_server_bindings= +etp_server_port=21 +etp_server_username= +etp_server_password= +etp_server_welcome_message= +etp_server_log_file_name= +etp_server_logging_enabled=0 +etp_server_log_max_size=4194304 +etp_server_log_delta_size=524288 +etp_server_allow_file_download=1 +ftp_allow_port=1 +ftp_check_data_connection_ip=1 +http_server_enabled=0 +http_server_bindings= +http_title_format= +http_server_port=80 +http_server_username= +http_server_password= +http_server_home= +http_server_default_page= +http_server_log_file_name= +http_server_logging_enabled=0 +http_server_log_max_size=4194304 +http_server_log_delta_size=524288 +http_server_allow_file_download=1 +http_server_items_per_page=32 +http_server_show_drive_labels=0 +http_server_strings= +http_server_header= +service_pipe_name= +name_column_pos=0 +name_column_width=256 +path_column_visible=1 +path_column_pos=1 +path_column_width=256 +size_column_visible=1 +size_column_pos=2 +size_column_width=96 +extension_column_visible=0 +extension_column_pos=3 +extension_column_width=96 +type_column_visible=0 +type_column_pos=4 +type_column_width=96 +last_write_time_column_visible=1 +last_write_time_column_pos=3 +last_write_time_column_width=153 +creation_time_column_visible=0 +creation_time_column_pos=6 +creation_time_column_width=153 +date_accessed_column_visible=0 +date_accessed_column_pos=7 +date_accessed_column_width=153 +attribute_column_visible=0 +attribute_column_pos=8 +attribute_column_width=70 +date_recently_changed_column_visible=0 +date_recently_changed_column_pos=9 +date_recently_changed_column_width=153 +run_count_column_visible=0 +run_count_column_pos=10 +run_count_column_width=96 +date_run_column_visible=0 +date_run_column_pos=11 +date_run_column_width=153 +file_list_filename_column_visible=0 +file_list_filename_column_pos=12 +file_list_filename_column_width=96 +translucent_selection_rectangle_background_color= +translucent_selection_rectangle_border_color= +thumbnail_mouseover_border_color= +preview_background_color= +ntfs_volume_guids="\\\\?\\Volume{6afe1915-0a0b-4e59-96bc-666ff914ea4f}","\\\\?\\Volume{71be44cf-e03a-462f-a9c8-b53c16e002a4}" +ntfs_volume_paths="C:","D:" +ntfs_volume_roots="","" +ntfs_volume_includes=1,1 +ntfs_volume_load_recent_changes=0,0 +ntfs_volume_include_onlys="","" +ntfs_volume_monitors=1,1 +refs_volume_guids= +refs_volume_paths= +refs_volume_roots= +refs_volume_includes= +refs_volume_load_recent_changes= +refs_volume_include_onlys= +refs_volume_monitors= +filelists= +filelist_monitor_changes= +folders= +folder_monitor_changes= +folder_buffer_size_list= +folder_rescan_if_full_list= +folder_update_types= +folder_update_days= +folder_update_ats= +folder_update_intervals= +folder_update_interval_types= +exclude_folders= +connect_history_hosts= +connect_history_ports= +connect_history_usernames= +connect_history_link_types= +etp_client_rewrite_patterns= +etp_client_rewrite_substitutions= +file_new_search_window_keys=334 +file_open_file_list_keys=335 +file_close_file_list_keys= +file_close_keys=343,27 +file_export_keys=339 +file_copy_full_name_to_clipboard_keys=9539 +file_copy_path_to_clipboard_keys= +file_set_run_count_keys= +file_create_shortcut_keys= +file_delete_keys=8238 +file_delete_permanently_keys=9262 +file_edit_keys= +file_open_keys=8205 +file_open_selection_and_close_everything_keys= +file_explore_path_keys= +file_open_new_keys= +file_open_path_keys=8461 +file_open_with_keys= +file_open_with_default_verb_keys= +file_play_keys= +file_preview_keys= +file_print_keys= +file_print_to_keys= +file_properties_keys=8717 +file_read_extended_information_keys=8517 +file_rename_keys=8305 +file_run_as_keys= +file_exit_keys=337 +file_copy_name_to_clipboard_keys= +file_open_selection_and_do_not_close_everything_keys= +file_open_most_run_keys= +file_open_last_run_keys= +file_custom_verb_1_keys= +file_custom_verb_2_keys= +file_custom_verb_3_keys= +file_custom_verb_4_keys= +file_custom_verb_5_keys= +file_custom_verb_6_keys= +file_custom_verb_7_keys= +file_custom_verb_8_keys= +file_custom_verb_9_keys= +file_custom_verb_10_keys= +file_custom_verb_11_keys= +file_custom_verb_12_keys= +indexes_folders_rescan_all_now_keys= +indexes_force_rebuild_keys= +edit_cut_keys=8536 +edit_copy_keys=8515,8493 +edit_paste_keys=8534,9261 +edit_select_all_keys=8513 +edit_invert_selection_keys= +edit_copy_to_folder_keys= +edit_move_to_folder_keys= +edit_advanced_advanced_copy_to_folder_keys= +edit_advanced_advanced_move_to_folder_keys= +view_filters_keys= +view_preview_keys=592 +view_status_bar_keys= +view_details_keys=1334 +view_medium_thumbnails_keys=1331 +view_large_thumbnails_keys=1330 +view_extra_large_thumbnails_keys=1329 +view_increase_thumbnail_size_keys=1467 +view_decrease_thumbnail_size_keys=1469 +view_window_size_small_keys=561 +view_window_size_medium_keys=562 +view_window_size_large_keys=563 +view_window_size_auto_fit_keys=564 +view_zoom_zoom_in_keys=443 +view_zoom_zoom_out_keys=445 +view_zoom_reset_keys=304,352 +view_go_to_back_keys=549,166 +view_go_to_forward_keys=551,167 +view_go_to_home_keys=548 +view_go_to_show_all_history_keys=1352,328 +view_sort_by_name_keys=305 +view_sort_by_path_keys=306 +view_sort_by_size_keys=307 +view_sort_by_extension_keys=308 +view_sort_by_type_keys=309 +view_sort_by_date_modified_keys=310 +view_sort_by_date_created_keys=311 +view_sort_by_attributes_keys=312 +view_sort_by_file_list_filename_keys= +view_sort_by_run_count_keys= +view_sort_by_date_run_keys= +view_sort_by_date_recently_changed_keys=313 +view_sort_by_date_accessed_keys= +view_sort_by_ascending_keys= +view_sort_by_descending_keys= +view_refresh_keys=116 +view_fullscreen_keys=122 +view_toggle_ltrrtl_direction_keys= +view_on_top_never_keys= +view_on_top_always_keys= +view_on_top_while_searching_keys= +search_match_case_keys=329 +search_match_whole_word_keys=322 +search_match_path_keys=341 +search_match_diacritics_keys=333 +search_enable_regex_keys=338 +search_advanced_search_keys= +search_add_to_filters_keys= +search_organize_filters_keys=1350 +bookmarks_add_to_bookmarks_keys=324 +bookmarks_organize_bookmarks_keys=1346 +tools_options_keys=336 +tools_console_keys=448 +tools_file_list_editor_keys= +tools_connect_to_etp_server_keys= +tools_disconnect_from_etp_server_keys= +help_everything_help_keys=112 +help_search_syntax_keys= +help_regex_syntax_keys= +help_command_line_options_keys= +help_everything_website_keys= +help_check_for_updates_keys= +help_about_everything_keys=368 +help_donate_keys= +search_edit_focus_search_edit_keys=326,114,580 +search_edit_delete_previous_word_keys=4360 +search_edit_auto_complete_search_keys=4384 +search_edit_show_search_history_keys= +search_edit_show_all_search_history_keys=4646,4648 +result_list_item_up_keys=8230,4134 +result_list_item_down_keys=8232,4136 +result_list_page_up_keys=8225,4129 +result_list_page_down_keys=8226,4130 +result_list_start_of_list_keys=8228 +result_list_end_of_list_keys=8227 +result_list_item_up_extend_keys=9254,5158 +result_list_item_down_extend_keys=9256,5160 +result_list_page_up_extend_keys=9249,5153 +result_list_page_down_extend_keys=9250,5154 +result_list_start_of_list_extend_keys=9252 +result_list_end_of_list_extend_keys=9251 +result_list_focus_up_keys=8486,4390 +result_list_focus_down_keys=8488,4392 +result_list_focus_page_up_keys=8481,4385 +result_list_focus_page_down_keys=8482,4386 +result_list_focus_start_of_list_keys=8484 +result_list_focus_end_of_list_keys=8483 +result_list_focus_up_extend_keys=9510,5414 +result_list_focus_down_extend_keys=9512,5416 +result_list_focus_page_up_extend_keys=9505,5409 +result_list_focus_page_down_extend_keys=9506,5410 +result_list_focus_start_of_list_extend_keys=9508 +result_list_focus_end_of_list_extend_keys=9507 +result_list_focus_result_list_keys= +result_list_focus_highest_run_count_result_keys= +result_list_focus_last_run_result_keys= +result_list_toggle_path_column_keys= +result_list_toggle_size_column_keys= +result_list_toggle_extension_column_keys= +result_list_toggle_type_column_keys= +result_list_toggle_date_modified_column_keys= +result_list_toggle_date_created_column_keys= +result_list_toggle_attributes_column_keys= +result_list_toggle_file_list_filename_column_keys= +result_list_toggle_run_count_column_keys= +result_list_toggle_date_recently_changed_column_keys= +result_list_toggle_date_accessed_column_keys= +result_list_toggle_date_run_column_keys= +result_list_size_all_columns_to_fit_keys=8555 +result_list_size_result_list_to_fit_keys= +result_list_context_menu_keys=9337 +result_list_scroll_left_or_thumbnail_left_keys=8229 +result_list_scroll_right_or_thumbnail_right_keys=8231 +result_list_scroll_page_left_or_thumbnail_focus_left_keys=8485 +result_list_scroll_page_right_or_thumbnail_focus_right_keys=8487 +result_list_left_extend_keys=9253 +result_list_right_extend_keys=9255 +result_list_focus_left_extend_keys=9509 +result_list_focus_right_extend_keys=9511 +result_list_select_focus_keys=8224 +result_list_toggle_focus_selection_keys=8480 +result_list_copy_as_csv_keys= +preview_focus_preview_keys= +result_list_font= +result_list_font_size= +search_edit_font= +search_edit_font_size= +status_bar_font= +status_bar_font_size= +header_font= +header_font_size= +normal_background_color= +normal_foreground_color= +normal_bold= +highlighted_background_color= +highlighted_foreground_color= +highlighted_bold= +current_sort_background_color= +current_sort_foreground_color= +current_sort_bold= +current_sort_highlighted_background_color= +current_sort_highlighted_foreground_color= +current_sort_highlighted_bold= +selected_background_color= +selected_foreground_color= +selected_bold= +selected_highlighted_background_color= +selected_highlighted_foreground_color= +selected_highlighted_bold= +selected_inactive_background_color= +selected_inactive_foreground_color= +selected_inactive_bold= +selected_inactive_highlighted_background_color= +selected_inactive_highlighted_foreground_color= +selected_inactive_highlighted_bold= +drop_target_background_color= +drop_target_foreground_color= +drop_target_bold= +drop_target_highlighted_background_color= +drop_target_highlighted_foreground_color= +drop_target_highlighted_bold= +mouseover_background_color= +mouseover_foreground_color= +mouseover_bold= +mouseover_highlighted_background_color= +mouseover_highlighted_foreground_color= +mouseover_highlighted_bold= +mouseover_current_sort_background_color= +mouseover_current_sort_foreground_color= +mouseover_current_sort_bold= +mouseover_current_sort_highlighted_background_color= +mouseover_current_sort_highlighted_foreground_color= +mouseover_current_sort_highlighted_bold= +alternate_row_background_color= +alternate_row_foreground_color= +alternate_row_bold= +alternate_row_highlighted_background_color= +alternate_row_highlighted_foreground_color= +alternate_row_highlighted_bold= +current_sort_alternate_row_background_color= +current_sort_alternate_row_foreground_color= +current_sort_alternate_row_bold= +current_sort_alternate_row_highlighted_background_color= +current_sort_alternate_row_highlighted_foreground_color= +current_sort_alternate_row_highlighted_bold= +hot_background_color= +hot_foreground_color= +hot_bold= +hot_highlighted_background_color= +hot_highlighted_foreground_color= +hot_highlighted_bold= +selected_hot_background_color= +selected_hot_foreground_color= +selected_hot_bold= +selected_hot_highlighted_background_color= +selected_hot_highlighted_foreground_color= +selected_hot_highlighted_bold= +selected_inactive_hot_background_color= +selected_inactive_hot_foreground_color= +selected_inactive_hot_bold= +selected_inactive_hot_highlighted_background_color= +selected_inactive_hot_highlighted_foreground_color= +selected_inactive_hot_highlighted_bold= +thumbnail_mouseover_background_color= +thumbnail_mouseover_foreground_color= +thumbnail_mouseover_bold= +thumbnail_mouseover_highlighted_background_color= +thumbnail_mouseover_highlighted_foreground_color= +thumbnail_mouseover_highlighted_bold= diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index e4d00fe..7d23819 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -70,7 +70,7 @@ namespace GeekDesk.Plugins.EveryThing { p.StartInfo.FileName = everyThingPath; p.Start(); - int waitTime = 3000; + int waitTime = 5000; while (true && waitTime > 0) { Thread.Sleep(100); diff --git a/Util/FileUtil.cs b/Util/FileUtil.cs index 3eb2996..8ab7cfc 100644 --- a/Util/FileUtil.cs +++ b/Util/FileUtil.cs @@ -4,6 +4,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; +using File = System.IO.File; namespace GeekDesk.Util { @@ -45,17 +46,22 @@ namespace GeekDesk.Util /// public static string GetArgByLnk(string filePath) { + //return ""; try { WshShell shell = new WshShell(); - IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath); - return shortcut.Arguments; + if (File.Exists(filePath)) + { + object shortcutObj = shell.CreateShortcut(filePath); + IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shortcutObj; + return shortcut.Arguments; + } } catch (Exception e) { //LogUtil.WriteErrorLog(e, "获取启动参数失败! filePath=" + filePath); - return ""; } + return ""; } /// From 280e66f457d3536d1f1beee399d1abf83c29db48 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Tue, 4 Apr 2023 18:07:27 +0800 Subject: [PATCH 13/44] :tada: every thing --- Plugins/EveryThing/EveryThingUtil.cs | 40 +++++++++++++++------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index 7d23819..ab31e8c 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -23,6 +23,10 @@ namespace GeekDesk.Plugins.EveryThing private static long pageCount = 20; private static UInt32 ui = 0; + private static Process serviceProcess = null; + private static Process exeProcess = null; + + public static void EnableEveryThing() { string pluginsPath = Constants.PLUGINS_PATH; @@ -52,33 +56,29 @@ namespace GeekDesk.Plugins.EveryThing if (!enabled) { //启动服务 - using (Process p = new Process()) - { - p.StartInfo.FileName = everyThingPath; - p.StartInfo.UseShellExecute = true; - p.StartInfo.Verb = "runas"; - p.StartInfo.Arguments = " -svc"; - p.Start(); - } + serviceProcess = new Process(); + serviceProcess.StartInfo.FileName = everyThingPath; + serviceProcess.StartInfo.UseShellExecute = true; + serviceProcess.StartInfo.Verb = "runas"; + serviceProcess.StartInfo.Arguments = " -svc"; + serviceProcess.Start(); } Thread.Sleep(2000); processList = Process.GetProcesses(); //启动程序 - using (Process p = new Process()) + exeProcess = new Process(); + exeProcess.StartInfo.FileName = everyThingPath; + exeProcess.Start(); + int waitTime = 5000; + while (true && waitTime > 0) { - p.StartInfo.FileName = everyThingPath; - p.Start(); - int waitTime = 5000; - while (true && waitTime > 0) - { - Thread.Sleep(100); - waitTime -= 100; - p.CloseMainWindow(); - } - + Thread.Sleep(100); + waitTime -= 100; + exeProcess.CloseMainWindow(); } + } catch (Exception e) { @@ -102,6 +102,8 @@ namespace GeekDesk.Plugins.EveryThing EveryThing32.Everything_Exit(); } } + if (exeProcess != null) exeProcess.Kill(); + if (serviceProcess != null) serviceProcess.Kill(); } From 26e4a7e4d580734bae8f3a0d78de1f5aee9e7cf8 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Thu, 6 Apr 2023 16:09:33 +0800 Subject: [PATCH 14/44] =?UTF-8?q?:white=5Fcheck=5Fmark:=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9B=91=E5=90=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.xaml.cs | 2 +- Util/FileWatcher.cs | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index b7ab8c4..c678528 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -332,7 +332,7 @@ namespace GeekDesk } //监听实时文件夹菜单 - FileWatcher.StartLinkMenuWatcher(appData); + FileWatcher.EnableLinkMenuWatcher(appData); //更新线程开启 检测更新 diff --git a/Util/FileWatcher.cs b/Util/FileWatcher.cs index 126f478..8aa1e1f 100644 --- a/Util/FileWatcher.cs +++ b/Util/FileWatcher.cs @@ -5,6 +5,7 @@ using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; namespace GeekDesk.Util @@ -88,7 +89,7 @@ namespace GeekDesk.Util /// 开启所有菜单监听 /// /// - public static void StartLinkMenuWatcher(AppData appData) + public static void EnableLinkMenuWatcher(AppData appData) { foreach (MenuInfo menuInfo in appData.MenuList) { @@ -97,6 +98,37 @@ namespace GeekDesk.Util LinkMenuWatcher(menuInfo); } } + RefreshLinkMenuIcon(appData); + } + + private static void RefreshLinkMenuIcon(AppData appData) + { + new Thread(() => + { + foreach (MenuInfo menuInfo in appData.MenuList) + { + if (menuInfo.MenuType == Constant.MenuType.LINK) + { + DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath); + FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos(); + + ObservableCollection iconList = new ObservableCollection(); + foreach (FileSystemInfo fileInfo in fileInfos) + { + IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName); + iconList.Add(iconInfo); + } + App.Current.Dispatcher.Invoke(() => + { + foreach (IconInfo iconInfo in iconList) + { + menuInfo.IconList = null; + menuInfo.IconList = iconList; + } + }); + } + } + }).Start(); } /// From 3a18882372e7cb0016d79296178b74c352cc5b9d Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Thu, 6 Apr 2023 18:10:49 +0800 Subject: [PATCH 15/44] =?UTF-8?q?:coffin:=20=E8=99=9A=E6=8B=9F=E5=8C=96?= =?UTF-8?q?=E7=8E=AF=E7=BB=95panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PannelCard/RightCardControl.xaml | 11 +- GeekDesk.csproj | 5 + MainWindow.xaml.cs | 7 +- Plugins/EveryThing/EveryThingUtil.cs | 8 + Util/WrpaPanel/ItemRange.cs | 25 + Util/WrpaPanel/ScrollDirection.cs | 14 + Util/WrpaPanel/SpacingMode.cs | 28 + Util/WrpaPanel/VirtualizingPanelBase.cs | 481 ++++++++++++++++++ Util/WrpaPanel/VirtualizingWrapPanel.cs | 474 +++++++++++++++++ 9 files changed, 1049 insertions(+), 4 deletions(-) create mode 100644 Util/WrpaPanel/ItemRange.cs create mode 100644 Util/WrpaPanel/ScrollDirection.cs create mode 100644 Util/WrpaPanel/SpacingMode.cs create mode 100644 Util/WrpaPanel/VirtualizingPanelBase.cs create mode 100644 Util/WrpaPanel/VirtualizingWrapPanel.cs diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml index d9ae435..3bbe658 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml +++ b/Control/UserControls/PannelCard/RightCardControl.xaml @@ -8,6 +8,7 @@ xmlns:cvt="clr-namespace:GeekDesk.Converts" xmlns:cst="clr-namespace:GeekDesk.Constant" xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel" + xmlns:util="clr-namespace:GeekDesk.Util" xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF" xmlns:ot="clr-namespace:GeekDesk.Control.Other" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}" @@ -204,7 +205,7 @@ HorizontalAlignment="Center" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>--> - - + + + + + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index c678528..1de0ddf 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -77,9 +77,12 @@ namespace GeekDesk /// private void SearchHotKeyDown(object sender, CanExecuteRoutedEventArgs e) { - if (appData.AppConfig.SearchType == SearchType.HOT_KEY) + if (appData.AppConfig.SearchType == SearchType.HOT_KEY && !RunTimeStatus.SEARCH_BOX_SHOW) { ShowSearchBox(); + } else if (RunTimeStatus.SEARCH_BOX_SHOW) + { + HidedSearchBox(); } } @@ -94,7 +97,7 @@ namespace GeekDesk SearchBox.Focus(); //执行一遍a查询 - SearchBox_TextChanged(null, null); + //SearchBox_TextChanged(null, null); } /// /// 搜索开始 diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index ab31e8c..209d0ca 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -132,6 +132,14 @@ namespace GeekDesk.Plugins.EveryThing public static ObservableCollection NextPage() { + if (ui == 0) + { + pageCount = 40; + } else + { + pageCount = 20; + } + string filePath; const int bufsize = 260; StringBuilder buf = new StringBuilder(bufsize); diff --git a/Util/WrpaPanel/ItemRange.cs b/Util/WrpaPanel/ItemRange.cs new file mode 100644 index 0000000..d1f15ae --- /dev/null +++ b/Util/WrpaPanel/ItemRange.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GeekDesk.Util.WrpaPanel +{ + public struct ItemRange + { + public int StartIndex { get; } + public int EndIndex { get; } + + public ItemRange(int startIndex, int endIndex) : this() + { + StartIndex = startIndex; + EndIndex = endIndex; + } + + public bool Contains(int itemIndex) + { + return itemIndex >= StartIndex && itemIndex <= EndIndex; + } + } +} diff --git a/Util/WrpaPanel/ScrollDirection.cs b/Util/WrpaPanel/ScrollDirection.cs new file mode 100644 index 0000000..17039b5 --- /dev/null +++ b/Util/WrpaPanel/ScrollDirection.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GeekDesk.Util.WrpaPanel +{ + public enum ScrollDirection + { + Vertical, + Horizontal + } +} diff --git a/Util/WrpaPanel/SpacingMode.cs b/Util/WrpaPanel/SpacingMode.cs new file mode 100644 index 0000000..a6dd264 --- /dev/null +++ b/Util/WrpaPanel/SpacingMode.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GeekDesk.Util.WrpaPanel +{ + public enum SpacingMode + { + /// + /// Spacing is disabled and all items will be arranged as closely as possible. + /// + None, + /// + /// The remaining space is evenly distributed between the items on a layout row, as well as the start and end of each row. + /// + Uniform, + /// + /// The remaining space is evenly distributed between the items on a layout row, excluding the start and end of each row. + /// + BetweenItemsOnly, + /// + /// The remaining space is evenly distributed between start and end of each row. + /// + StartAndEndOnly + } +} diff --git a/Util/WrpaPanel/VirtualizingPanelBase.cs b/Util/WrpaPanel/VirtualizingPanelBase.cs new file mode 100644 index 0000000..0517ae0 --- /dev/null +++ b/Util/WrpaPanel/VirtualizingPanelBase.cs @@ -0,0 +1,481 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls.Primitives; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows; + +namespace GeekDesk.Util.WrpaPanel +{ + public abstract class VirtualizingPanelBase : VirtualizingPanel, IScrollInfo + { + public static readonly DependencyProperty ScrollLineDeltaProperty = DependencyProperty.Register(nameof(ScrollLineDelta), typeof(double), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(16.0)); + public static readonly DependencyProperty MouseWheelDeltaProperty = DependencyProperty.Register(nameof(MouseWheelDelta), typeof(double), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(48.0)); + public static readonly DependencyProperty ScrollLineDeltaItemProperty = DependencyProperty.Register(nameof(ScrollLineDeltaItem), typeof(int), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(1)); + public static readonly DependencyProperty MouseWheelDeltaItemProperty = DependencyProperty.Register(nameof(MouseWheelDeltaItem), typeof(int), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(3)); + + public ScrollViewer? ScrollOwner { get; set; } + + public bool CanVerticallyScroll { get; set; } + public bool CanHorizontallyScroll { get; set; } + + protected override bool CanHierarchicallyScrollAndVirtualizeCore => true; + + /// + /// Scroll line delta for pixel based scrolling. The default value is 16 dp. + /// + public double ScrollLineDelta { get => (double)GetValue(ScrollLineDeltaProperty); set => SetValue(ScrollLineDeltaProperty, value); } + + /// + /// Mouse wheel delta for pixel based scrolling. The default value is 48 dp. + /// + public double MouseWheelDelta { get => (double)GetValue(MouseWheelDeltaProperty); set => SetValue(MouseWheelDeltaProperty, value); } + + /// + /// Scroll line delta for item based scrolling. The default value is 1 item. + /// + public double ScrollLineDeltaItem { get => (int)GetValue(ScrollLineDeltaItemProperty); set => SetValue(ScrollLineDeltaItemProperty, value); } + + /// + /// Mouse wheel delta for item based scrolling. The default value is 3 items. + /// + public int MouseWheelDeltaItem { get => (int)GetValue(MouseWheelDeltaItemProperty); set => SetValue(MouseWheelDeltaItemProperty, value); } + + protected ScrollUnit ScrollUnit => GetScrollUnit(ItemsControl); + + /// + /// The direction in which the panel scrolls when user turns the mouse wheel. + /// + protected ScrollDirection MouseWheelScrollDirection { get; set; } = ScrollDirection.Vertical; + + + protected bool IsVirtualizing => GetIsVirtualizing(ItemsControl); + + protected VirtualizationMode VirtualizationMode => GetVirtualizationMode(ItemsControl); + + /// + /// Returns true if the panel is in VirtualizationMode.Recycling, otherwise false. + /// + protected bool IsRecycling => VirtualizationMode == VirtualizationMode.Recycling; + + /// + /// The cache length before and after the viewport. + /// + protected VirtualizationCacheLength CacheLength { get; private set; } + + /// + /// The Unit of the cache length. Can be Pixel, Item or Page. + /// When the ItemsOwner is a group item it can only be pixel or item. + /// + protected VirtualizationCacheLengthUnit CacheLengthUnit { get; private set; } + + + /// + /// The ItemsControl (e.g. ListView). + /// + protected ItemsControl ItemsControl => ItemsControl.GetItemsOwner(this); + + /// + /// The ItemsControl (e.g. ListView) or if the ItemsControl is grouping a GroupItem. + /// + protected DependencyObject ItemsOwner + { + get + { + if (_itemsOwner is null) + { + /* Use reflection to access internal method because the public + * GetItemsOwner method does always return the itmes control instead + * of the real items owner for example the group item when grouping */ + MethodInfo getItemsOwnerInternalMethod = typeof(ItemsControl).GetMethod( + "GetItemsOwnerInternal", + BindingFlags.Static | BindingFlags.NonPublic, + null, + new Type[] { typeof(DependencyObject) }, + null + )!; + _itemsOwner = (DependencyObject)getItemsOwnerInternalMethod.Invoke(null, new object[] { this })!; + } + return _itemsOwner; + } + } + private DependencyObject? _itemsOwner; + + protected ReadOnlyCollection Items => ((ItemContainerGenerator)ItemContainerGenerator).Items; + + protected new IRecyclingItemContainerGenerator ItemContainerGenerator + { + get + { + if (_itemContainerGenerator is null) + { + /* Because of a bug in the framework the ItemContainerGenerator + * is null until InternalChildren accessed at least one time. */ + var children = InternalChildren; + _itemContainerGenerator = (IRecyclingItemContainerGenerator)base.ItemContainerGenerator; + } + return _itemContainerGenerator; + } + } + private IRecyclingItemContainerGenerator? _itemContainerGenerator; + + public double ExtentWidth => Extent.Width; + public double ExtentHeight => Extent.Height; + protected Size Extent { get; private set; } = new Size(0, 0); + + public double HorizontalOffset => Offset.X; + public double VerticalOffset => Offset.Y; + protected Size Viewport { get; private set; } = new Size(0, 0); + + public double ViewportWidth => Viewport.Width; + public double ViewportHeight => Viewport.Height; + protected Point Offset { get; private set; } = new Point(0, 0); + + /// + /// The range of items that a realized in viewport or cache. + /// + protected ItemRange ItemRange { get; set; } + + private Visibility previousVerticalScrollBarVisibility = Visibility.Collapsed; + private Visibility previousHorizontalScrollBarVisibility = Visibility.Collapsed; + + protected virtual void UpdateScrollInfo(Size availableSize, Size extent) + { + bool invalidateScrollInfo = false; + + if (extent != Extent) + { + Extent = extent; + invalidateScrollInfo = true; + + } + if (availableSize != Viewport) + { + Viewport = availableSize; + invalidateScrollInfo = true; + } + + if (ViewportHeight != 0 && VerticalOffset != 0 && VerticalOffset + ViewportHeight + 1 >= ExtentHeight) + { + Offset = new Point(Offset.X, extent.Height - availableSize.Height); + invalidateScrollInfo = true; + } + if (ViewportWidth != 0 && HorizontalOffset != 0 && HorizontalOffset + ViewportWidth + 1 >= ExtentWidth) + { + Offset = new Point(extent.Width - availableSize.Width, Offset.Y); + invalidateScrollInfo = true; + } + + if (invalidateScrollInfo) + { + ScrollOwner?.InvalidateScrollInfo(); + } + } + + public virtual Rect MakeVisible(Visual visual, Rect rectangle) + { + Point pos = visual.TransformToAncestor(this).Transform(Offset); + + double scrollAmountX = 0; + double scrollAmountY = 0; + + if (pos.X < Offset.X) + { + scrollAmountX = -(Offset.X - pos.X); + } + else if ((pos.X + rectangle.Width) > (Offset.X + Viewport.Width)) + { + double notVisibleX = (pos.X + rectangle.Width) - (Offset.X + Viewport.Width); + double maxScrollX = pos.X - Offset.X; // keep left of the visual visible + scrollAmountX = Math.Min(notVisibleX, maxScrollX); + } + + if (pos.Y < Offset.Y) + { + scrollAmountY = -(Offset.Y - pos.Y); + } + else if ((pos.Y + rectangle.Height) > (Offset.Y + Viewport.Height)) + { + double notVisibleY = (pos.Y + rectangle.Height) - (Offset.Y + Viewport.Height); + double maxScrollY = pos.Y - Offset.Y; // keep top of the visual visible + scrollAmountY = Math.Min(notVisibleY, maxScrollY); + } + + SetHorizontalOffset(Offset.X + scrollAmountX); + SetVerticalOffset(Offset.Y + scrollAmountY); + + double visibleRectWidth = Math.Min(rectangle.Width, Viewport.Width); + double visibleRectHeight = Math.Min(rectangle.Height, Viewport.Height); + + return new Rect(scrollAmountX, scrollAmountY, visibleRectWidth, visibleRectHeight); + } + + protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args) + { + switch (args.Action) + { + case NotifyCollectionChangedAction.Remove: + case NotifyCollectionChangedAction.Replace: + RemoveInternalChildRange(args.Position.Index, args.ItemUICount); + break; + case NotifyCollectionChangedAction.Move: + RemoveInternalChildRange(args.OldPosition.Index, args.ItemUICount); + break; + } + } + + protected int GetItemIndexFromChildIndex(int childIndex) + { + var generatorPosition = GetGeneratorPositionFromChildIndex(childIndex); + return ItemContainerGenerator.IndexFromGeneratorPosition(generatorPosition); + } + + protected virtual GeneratorPosition GetGeneratorPositionFromChildIndex(int childIndex) + { + return new GeneratorPosition(childIndex, 0); + } + + protected override Size MeasureOverride(Size availableSize) + { + /* Sometimes when scrolling the scrollbar gets hidden without any reason. In this case the "IsMeasureValid" + * property of the ScrollOwner is false. To prevent a infinite circle the mesasure call is ignored. */ + if (ScrollOwner != null) + { + bool verticalScrollBarGotHidden = ScrollOwner.VerticalScrollBarVisibility == ScrollBarVisibility.Auto + && ScrollOwner.ComputedVerticalScrollBarVisibility != Visibility.Visible + && ScrollOwner.ComputedVerticalScrollBarVisibility != previousVerticalScrollBarVisibility; + + bool horizontalScrollBarGotHidden = ScrollOwner.HorizontalScrollBarVisibility == ScrollBarVisibility.Auto + && ScrollOwner.ComputedHorizontalScrollBarVisibility != Visibility.Visible + && ScrollOwner.ComputedHorizontalScrollBarVisibility != previousHorizontalScrollBarVisibility; + + previousVerticalScrollBarVisibility = ScrollOwner.ComputedVerticalScrollBarVisibility; + previousHorizontalScrollBarVisibility = ScrollOwner.ComputedHorizontalScrollBarVisibility; + + if (!ScrollOwner.IsMeasureValid && verticalScrollBarGotHidden || horizontalScrollBarGotHidden) + { + return availableSize; + } + } + + var groupItem = ItemsOwner as IHierarchicalVirtualizationAndScrollInfo; + + Size extent; + Size desiredSize; + + if (groupItem != null) + { + /* If the ItemsOwner is a group item the availableSize is ifinity. + * Therfore the vieport size provided by the group item is used. */ + var viewportSize = groupItem.Constraints.Viewport.Size; + var headerSize = groupItem.HeaderDesiredSizes.PixelSize; + double availableWidth = Math.Max(viewportSize.Width - 5, 0); // left margin of 5 dp + double availableHeight = Math.Max(viewportSize.Height - headerSize.Height, 0); + availableSize = new Size(availableWidth, availableHeight); + + extent = CalculateExtent(availableSize); + + desiredSize = new Size(extent.Width, extent.Height); + + Extent = extent; + Offset = groupItem.Constraints.Viewport.Location; + Viewport = groupItem.Constraints.Viewport.Size; + CacheLength = groupItem.Constraints.CacheLength; + CacheLengthUnit = groupItem.Constraints.CacheLengthUnit; // can be Item or Pixel + } + else + { + extent = CalculateExtent(availableSize); + double desiredWidth = Math.Min(availableSize.Width, extent.Width); + double desiredHeight = Math.Min(availableSize.Height, extent.Height); + desiredSize = new Size(desiredWidth, desiredHeight); + + UpdateScrollInfo(desiredSize, extent); + CacheLength = GetCacheLength(ItemsOwner); + CacheLengthUnit = GetCacheLengthUnit(ItemsOwner); // can be Page, Item or Pixel + } + + ItemRange = UpdateItemRange(); + + RealizeItems(); + VirtualizeItems(); + + return desiredSize; + } + + /// + /// Realizes visible and cached items. + /// + protected virtual void RealizeItems() + { + var startPosition = ItemContainerGenerator.GeneratorPositionFromIndex(ItemRange.StartIndex); + + int childIndex = startPosition.Offset == 0 ? startPosition.Index : startPosition.Index + 1; + + using (ItemContainerGenerator.StartAt(startPosition, GeneratorDirection.Forward, true)) + { + for (int i = ItemRange.StartIndex; i <= ItemRange.EndIndex; i++, childIndex++) + { + UIElement child = (UIElement)ItemContainerGenerator.GenerateNext(out bool isNewlyRealized); + if (isNewlyRealized || /*recycled*/!InternalChildren.Contains(child)) + { + if (childIndex >= InternalChildren.Count) + { + AddInternalChild(child); + } + else + { + InsertInternalChild(childIndex, child); + } + ItemContainerGenerator.PrepareItemContainer(child); + + child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); + } + + if (child is IHierarchicalVirtualizationAndScrollInfo groupItem) + { + groupItem.Constraints = new HierarchicalVirtualizationConstraints( + new VirtualizationCacheLength(0), + VirtualizationCacheLengthUnit.Item, + new Rect(0, 0, ViewportWidth, ViewportHeight)); + child.Measure(new Size(ViewportWidth, ViewportHeight)); + } + } + } + } + + /// + /// Virtualizes (cleanups) no longer visible or cached items. + /// + protected virtual void VirtualizeItems() + { + for (int childIndex = InternalChildren.Count - 1; childIndex >= 0; childIndex--) + { + var generatorPosition = GetGeneratorPositionFromChildIndex(childIndex); + + int itemIndex = ItemContainerGenerator.IndexFromGeneratorPosition(generatorPosition); + + if (itemIndex != -1 && !ItemRange.Contains(itemIndex)) + { + if (VirtualizationMode == VirtualizationMode.Recycling) + { + ItemContainerGenerator.Recycle(generatorPosition, 1); + } + else + { + ItemContainerGenerator.Remove(generatorPosition, 1); + } + RemoveInternalChildRange(childIndex, 1); + } + } + } + + /// + /// Calculates the extent that would be needed to show all items. + /// + protected abstract Size CalculateExtent(Size availableSize); + + /// + /// Calculates the item range that is visible in the viewport or cached. + /// + protected abstract ItemRange UpdateItemRange(); + + public void SetVerticalOffset(double offset) + { + if (offset < 0 || Viewport.Height >= Extent.Height) + { + offset = 0; + } + else if (offset + Viewport.Height >= Extent.Height) + { + offset = Extent.Height - Viewport.Height; + } + Offset = new Point(Offset.X, offset); + ScrollOwner?.InvalidateScrollInfo(); + InvalidateMeasure(); + } + + public void SetHorizontalOffset(double offset) + { + if (offset < 0 || Viewport.Width >= Extent.Width) + { + offset = 0; + } + else if (offset + Viewport.Width >= Extent.Width) + { + offset = Extent.Width - Viewport.Width; + } + Offset = new Point(offset, Offset.Y); + ScrollOwner?.InvalidateScrollInfo(); + InvalidateMeasure(); + } + + protected void ScrollVertical(double amount) + { + SetVerticalOffset(VerticalOffset + amount); + } + + protected void ScrollHorizontal(double amount) + { + SetHorizontalOffset(HorizontalOffset + amount); + } + + public void LineUp() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? -ScrollLineDelta : GetLineUpScrollAmount()); + public void LineDown() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? ScrollLineDelta : GetLineDownScrollAmount()); + public void LineLeft() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? -ScrollLineDelta : GetLineLeftScrollAmount()); + public void LineRight() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? ScrollLineDelta : GetLineRightScrollAmount()); + + public void MouseWheelUp() + { + if (MouseWheelScrollDirection == ScrollDirection.Vertical) + { + ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? -MouseWheelDelta : GetMouseWheelUpScrollAmount()); + } + else + { + MouseWheelLeft(); + } + } + + public void MouseWheelDown() + { + if (MouseWheelScrollDirection == ScrollDirection.Vertical) + { + ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? MouseWheelDelta : GetMouseWheelDownScrollAmount()); + } + else + { + MouseWheelRight(); + } + } + + public void MouseWheelLeft() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? -MouseWheelDelta : GetMouseWheelLeftScrollAmount()); + public void MouseWheelRight() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? MouseWheelDelta : GetMouseWheelRightScrollAmount()); + + public void PageUp() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? -ViewportHeight : GetPageUpScrollAmount()); + public void PageDown() => ScrollVertical(ScrollUnit == ScrollUnit.Pixel ? ViewportHeight : GetPageDownScrollAmount()); + public void PageLeft() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? -ViewportHeight : GetPageLeftScrollAmount()); + public void PageRight() => ScrollHorizontal(ScrollUnit == ScrollUnit.Pixel ? ViewportHeight : GetPageRightScrollAmount()); + + protected abstract double GetLineUpScrollAmount(); + protected abstract double GetLineDownScrollAmount(); + protected abstract double GetLineLeftScrollAmount(); + protected abstract double GetLineRightScrollAmount(); + + protected abstract double GetMouseWheelUpScrollAmount(); + protected abstract double GetMouseWheelDownScrollAmount(); + protected abstract double GetMouseWheelLeftScrollAmount(); + protected abstract double GetMouseWheelRightScrollAmount(); + + protected abstract double GetPageUpScrollAmount(); + protected abstract double GetPageDownScrollAmount(); + protected abstract double GetPageLeftScrollAmount(); + protected abstract double GetPageRightScrollAmount(); + } +} diff --git a/Util/WrpaPanel/VirtualizingWrapPanel.cs b/Util/WrpaPanel/VirtualizingWrapPanel.cs new file mode 100644 index 0000000..a7e26ca --- /dev/null +++ b/Util/WrpaPanel/VirtualizingWrapPanel.cs @@ -0,0 +1,474 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls.Primitives; +using System.Windows.Controls; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows; +using GeekDesk.Util.WrpaPanel; + +namespace GeekDesk.Util.WrpaPanel +{ + public class VirtualizingWrapPanel : VirtualizingPanelBase + { + #region Deprecated properties + + [Obsolete("Use SpacingMode")] + public static readonly DependencyProperty IsSpacingEnabledProperty = DependencyProperty.Register(nameof(IsSpacingEnabled), typeof(bool), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsMeasure)); + + [Obsolete("Use IsSpacingEnabled")] + public bool SpacingEnabled { get => IsSpacingEnabled; set => IsSpacingEnabled = value; } + + /// + /// Gets or sets a value that specifies whether the items are distributed evenly across the width (horizontal orientation) + /// or height (vertical orientation). The default value is true. + /// + [Obsolete("Use SpacingMode")] + public bool IsSpacingEnabled { get => (bool)GetValue(IsSpacingEnabledProperty); set => SetValue(IsSpacingEnabledProperty, value); } + + [Obsolete("Use ItemSize")] + public Size ChildrenSize { get => ItemSize; set => ItemSize = value; } + + #endregion + + public static readonly DependencyProperty SpacingModeProperty = DependencyProperty.Register(nameof(SpacingMode), typeof(SpacingMode), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(SpacingMode.Uniform, FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(nameof(Orientation), typeof(Orientation), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(Orientation.Vertical, FrameworkPropertyMetadataOptions.AffectsMeasure, (obj, args) => ((VirtualizingWrapPanel)obj).Orientation_Changed())); + + public static readonly DependencyProperty ItemSizeProperty = DependencyProperty.Register(nameof(ItemSize), typeof(Size), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(Size.Empty, FrameworkPropertyMetadataOptions.AffectsMeasure)); + + public static readonly DependencyProperty StretchItemsProperty = DependencyProperty.Register(nameof(StretchItems), typeof(bool), typeof(VirtualizingWrapPanel), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsArrange)); + + /// + /// Gets or sets the spacing mode used when arranging the items. The default value is . + /// + public SpacingMode SpacingMode { get => (SpacingMode)GetValue(SpacingModeProperty); set => SetValue(SpacingModeProperty, value); } + + /// + /// Gets or sets a value that specifies the orientation in which items are arranged. The default value is . + /// + public Orientation Orientation { get => (Orientation)GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); } + + /// + /// Gets or sets a value that specifies the size of the items. The default value is . + /// If the value is the size of the items gots measured by the first realized item. + /// + public Size ItemSize { get => (Size)GetValue(ItemSizeProperty); set => SetValue(ItemSizeProperty, value); } + + /// + /// Gets or sets a value that specifies if the items get stretched to fill up remaining space. The default value is false. + /// + /// + /// The MaxWidth and MaxHeight properties of the ItemContainerStyle can be used to limit the stretching. + /// In this case the use of the remaining space will be determined by the SpacingMode property. + /// + public bool StretchItems { get => (bool)GetValue(StretchItemsProperty); set => SetValue(StretchItemsProperty, value); } + + protected Size childSize; + + protected int rowCount; + + protected int itemsPerRowCount; + + private void Orientation_Changed() + { + MouseWheelScrollDirection = Orientation == Orientation.Vertical ? ScrollDirection.Vertical : ScrollDirection.Horizontal; + } + + protected override Size MeasureOverride(Size availableSize) + { + UpdateChildSize(availableSize); + return base.MeasureOverride(availableSize); + } + + private void UpdateChildSize(Size availableSize) + { + if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem + && VirtualizingPanel.GetIsVirtualizingWhenGrouping(ItemsControl)) + { + if (Orientation == Orientation.Vertical) + { + availableSize.Width = groupItem.Constraints.Viewport.Size.Width; + availableSize.Width = Math.Max(availableSize.Width - (Margin.Left + Margin.Right), 0); + } + else + { + availableSize.Height = groupItem.Constraints.Viewport.Size.Height; + availableSize.Height = Math.Max(availableSize.Height - (Margin.Top + Margin.Bottom), 0); + } + } + + if (ItemSize != Size.Empty) + { + childSize = ItemSize; + } + else if (InternalChildren.Count != 0) + { + childSize = InternalChildren[0].DesiredSize; + } + else + { + childSize = CalculateChildSize(availableSize); + } + + if (double.IsInfinity(GetWidth(availableSize))) + { + itemsPerRowCount = Items.Count; + } + else + { + itemsPerRowCount = Math.Max(1, (int)Math.Floor(GetWidth(availableSize) / GetWidth(childSize))); + } + + rowCount = (int)Math.Ceiling((double)Items.Count / itemsPerRowCount); + } + + private Size CalculateChildSize(Size availableSize) + { + if (Items.Count == 0) + { + return new Size(0, 0); + } + var startPosition = ItemContainerGenerator.GeneratorPositionFromIndex(0); + using (ItemContainerGenerator.StartAt(startPosition, GeneratorDirection.Forward, true)) + { + var child = (UIElement)ItemContainerGenerator.GenerateNext(); + AddInternalChild(child); + ItemContainerGenerator.PrepareItemContainer(child); + child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); + return child.DesiredSize; + } + } + + protected override Size CalculateExtent(Size availableSize) + { + double extentWidth = IsSpacingEnabled && SpacingMode != SpacingMode.None && !double.IsInfinity(GetWidth(availableSize)) + ? GetWidth(availableSize) + : GetWidth(childSize) * itemsPerRowCount; + + if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem) + { + if (Orientation == Orientation.Vertical) + { + extentWidth = Math.Max(extentWidth - (Margin.Left + Margin.Right), 0); + } + else + { + extentWidth = Math.Max(extentWidth - (Margin.Top + Margin.Bottom), 0); + } + } + + double extentHeight = GetHeight(childSize) * rowCount; + return CreateSize(extentWidth, extentHeight); + } + + protected void CalculateSpacing(Size finalSize, out double innerSpacing, out double outerSpacing) + { + Size childSize = CalculateChildArrangeSize(finalSize); + + double finalWidth = GetWidth(finalSize); + + double totalItemsWidth = Math.Min(GetWidth(childSize) * itemsPerRowCount, finalWidth); + double unusedWidth = finalWidth - totalItemsWidth; + + SpacingMode spacingMode = IsSpacingEnabled ? SpacingMode : SpacingMode.None; + + switch (spacingMode) + { + case SpacingMode.Uniform: + innerSpacing = outerSpacing = unusedWidth / (itemsPerRowCount + 1); + break; + + case SpacingMode.BetweenItemsOnly: + innerSpacing = unusedWidth / Math.Max(itemsPerRowCount - 1, 1); + outerSpacing = 0; + break; + + case SpacingMode.StartAndEndOnly: + innerSpacing = 0; + outerSpacing = unusedWidth / 2; + break; + + case SpacingMode.None: + default: + innerSpacing = 0; + outerSpacing = 0; + break; + } + } + + protected override Size ArrangeOverride(Size finalSize) + { + double offsetX = GetX(Offset); + double offsetY = GetY(Offset); + + /* When the items owner is a group item offset is handled by the parent panel. */ + if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem) + { + offsetY = 0; + } + + Size childSize = CalculateChildArrangeSize(finalSize); + + CalculateSpacing(finalSize, out double innerSpacing, out double outerSpacing); + + for (int childIndex = 0; childIndex < InternalChildren.Count; childIndex++) + { + UIElement child = InternalChildren[childIndex]; + + int itemIndex = GetItemIndexFromChildIndex(childIndex); + + int columnIndex = itemIndex % itemsPerRowCount; + int rowIndex = itemIndex / itemsPerRowCount; + + double x = outerSpacing + columnIndex * (GetWidth(childSize) + innerSpacing); + double y = rowIndex * GetHeight(childSize); + + if (GetHeight(finalSize) == 0.0) + { + /* When the parent panel is grouping and a cached group item is not + * in the viewport it has no valid arrangement. That means that the + * height/width is 0. Therefore the items should not be visible so + * that they are not falsely displayed. */ + child.Arrange(new Rect(0, 0, 0, 0)); + } + else + { + child.Arrange(CreateRect(x - offsetX, y - offsetY, childSize.Width, childSize.Height)); + } + } + + return finalSize; + } + + protected Size CalculateChildArrangeSize(Size finalSize) + { + if (StretchItems) + { + if (Orientation == Orientation.Vertical) + { + double childMaxWidth = ReadItemContainerStyle(MaxWidthProperty, double.PositiveInfinity); + double maxPossibleChildWith = finalSize.Width / itemsPerRowCount; + double childWidth = Math.Min(maxPossibleChildWith, childMaxWidth); + return new Size(childWidth, childSize.Height); + } + else + { + double childMaxHeight = ReadItemContainerStyle(MaxHeightProperty, double.PositiveInfinity); + double maxPossibleChildHeight = finalSize.Height / itemsPerRowCount; + double childHeight = Math.Min(maxPossibleChildHeight, childMaxHeight); + return new Size(childSize.Width, childHeight); + } + } + else + { + return childSize; + } + } + + private T ReadItemContainerStyle(DependencyProperty property, T fallbackValue) where T : notnull + { + var value = ItemsControl.ItemContainerStyle?.Setters.OfType() + .FirstOrDefault(setter => setter.Property == property)?.Value; + return (T)(value ?? fallbackValue); + } + + protected override ItemRange UpdateItemRange() + { + if (!IsVirtualizing) + { + return new ItemRange(0, Items.Count - 1); + } + + int startIndex; + int endIndex; + + if (ItemsOwner is IHierarchicalVirtualizationAndScrollInfo groupItem) + { + if (!VirtualizingPanel.GetIsVirtualizingWhenGrouping(ItemsControl)) + { + return new ItemRange(0, Items.Count - 1); + } + + var offset = new Point(Offset.X, groupItem.Constraints.Viewport.Location.Y); + + int offsetRowIndex; + double offsetInPixel; + + int rowCountInViewport; + + if (ScrollUnit == ScrollUnit.Item) + { + offsetRowIndex = GetY(offset) >= 1 ? (int)GetY(offset) - 1 : 0; // ignore header + offsetInPixel = offsetRowIndex * GetHeight(childSize); + } + else + { + offsetInPixel = Math.Min(Math.Max(GetY(offset) - GetHeight(groupItem.HeaderDesiredSizes.PixelSize), 0), GetHeight(Extent)); + offsetRowIndex = GetRowIndex(offsetInPixel); + } + + double viewportHeight = Math.Min(GetHeight(Viewport), Math.Max(GetHeight(Extent) - offsetInPixel, 0)); + + rowCountInViewport = (int)Math.Ceiling((offsetInPixel + viewportHeight) / GetHeight(childSize)) - (int)Math.Floor(offsetInPixel / GetHeight(childSize)); + + startIndex = offsetRowIndex * itemsPerRowCount; + endIndex = Math.Min(((offsetRowIndex + rowCountInViewport) * itemsPerRowCount) - 1, Items.Count - 1); + + if (CacheLengthUnit == VirtualizationCacheLengthUnit.Pixel) + { + double cacheBeforeInPixel = Math.Min(CacheLength.CacheBeforeViewport, offsetInPixel); + double cacheAfterInPixel = Math.Min(CacheLength.CacheAfterViewport, GetHeight(Extent) - viewportHeight - offsetInPixel); + int rowCountInCacheBefore = (int)(cacheBeforeInPixel / GetHeight(childSize)); + int rowCountInCacheAfter = ((int)Math.Ceiling((offsetInPixel + viewportHeight + cacheAfterInPixel) / GetHeight(childSize))) - (int)Math.Ceiling((offsetInPixel + viewportHeight) / GetHeight(childSize)); + startIndex = Math.Max(startIndex - rowCountInCacheBefore * itemsPerRowCount, 0); + endIndex = Math.Min(endIndex + rowCountInCacheAfter * itemsPerRowCount, Items.Count - 1); + } + else if (CacheLengthUnit == VirtualizationCacheLengthUnit.Item) + { + startIndex = Math.Max(startIndex - (int)CacheLength.CacheBeforeViewport, 0); + endIndex = Math.Min(endIndex + (int)CacheLength.CacheAfterViewport, Items.Count - 1); + } + } + else + { + double viewportSartPos = GetY(Offset); + double viewportEndPos = GetY(Offset) + GetHeight(Viewport); + + if (CacheLengthUnit == VirtualizationCacheLengthUnit.Pixel) + { + viewportSartPos = Math.Max(viewportSartPos - CacheLength.CacheBeforeViewport, 0); + viewportEndPos = Math.Min(viewportEndPos + CacheLength.CacheAfterViewport, GetHeight(Extent)); + } + + int startRowIndex = GetRowIndex(viewportSartPos); + startIndex = startRowIndex * itemsPerRowCount; + + int endRowIndex = GetRowIndex(viewportEndPos); + endIndex = Math.Min(endRowIndex * itemsPerRowCount + (itemsPerRowCount - 1), Items.Count - 1); + + if (CacheLengthUnit == VirtualizationCacheLengthUnit.Page) + { + int itemsPerPage = endIndex - startIndex + 1; + startIndex = Math.Max(startIndex - (int)CacheLength.CacheBeforeViewport * itemsPerPage, 0); + endIndex = Math.Min(endIndex + (int)CacheLength.CacheAfterViewport * itemsPerPage, Items.Count - 1); + } + else if (CacheLengthUnit == VirtualizationCacheLengthUnit.Item) + { + startIndex = Math.Max(startIndex - (int)CacheLength.CacheBeforeViewport, 0); + endIndex = Math.Min(endIndex + (int)CacheLength.CacheAfterViewport, Items.Count - 1); + } + } + + return new ItemRange(startIndex, endIndex); + } + + private int GetRowIndex(double location) + { + int calculatedRowIndex = (int)Math.Floor(location / GetHeight(childSize)); + int maxRowIndex = (int)Math.Ceiling((double)Items.Count / (double)itemsPerRowCount); + return Math.Max(Math.Min(calculatedRowIndex, maxRowIndex), 0); + } + + protected override void BringIndexIntoView(int index) + { + if (index < 0 || index >= Items.Count) + { + throw new ArgumentOutOfRangeException(nameof(index), $"The argument {nameof(index)} must be >= 0 and < the number of items."); + } + + if (itemsPerRowCount == 0) + { + throw new InvalidOperationException(); + } + + var offset = (index / itemsPerRowCount) * GetHeight(childSize); + + if (Orientation == Orientation.Horizontal) + { + SetHorizontalOffset(offset); + } + else + { + SetVerticalOffset(offset); + } + } + + protected override double GetLineUpScrollAmount() + { + return -Math.Min(childSize.Height * ScrollLineDeltaItem, Viewport.Height); + } + + protected override double GetLineDownScrollAmount() + { + return Math.Min(childSize.Height * ScrollLineDeltaItem, Viewport.Height); + } + + protected override double GetLineLeftScrollAmount() + { + return -Math.Min(childSize.Width * ScrollLineDeltaItem, Viewport.Width); + } + + protected override double GetLineRightScrollAmount() + { + return Math.Min(childSize.Width * ScrollLineDeltaItem, Viewport.Width); + } + + protected override double GetMouseWheelUpScrollAmount() + { + return -Math.Min(childSize.Height * MouseWheelDeltaItem, Viewport.Height); + } + + protected override double GetMouseWheelDownScrollAmount() + { + return Math.Min(childSize.Height * MouseWheelDeltaItem, Viewport.Height); + } + + protected override double GetMouseWheelLeftScrollAmount() + { + return -Math.Min(childSize.Width * MouseWheelDeltaItem, Viewport.Width); + } + + protected override double GetMouseWheelRightScrollAmount() + { + return Math.Min(childSize.Width * MouseWheelDeltaItem, Viewport.Width); + } + + protected override double GetPageUpScrollAmount() + { + return -Viewport.Height; + } + + protected override double GetPageDownScrollAmount() + { + return Viewport.Height; + } + + protected override double GetPageLeftScrollAmount() + { + return -Viewport.Width; + } + + protected override double GetPageRightScrollAmount() + { + return Viewport.Width; + } + + /* orientation aware helper methods */ + + protected double GetX(Point point) => Orientation == Orientation.Vertical ? point.X : point.Y; + protected double GetY(Point point) => Orientation == Orientation.Vertical ? point.Y : point.X; + + protected double GetWidth(Size size) => Orientation == Orientation.Vertical ? size.Width : size.Height; + protected double GetHeight(Size size) => Orientation == Orientation.Vertical ? size.Height : size.Width; + + protected Size CreateSize(double width, double height) => Orientation == Orientation.Vertical ? new Size(width, height) : new Size(height, width); + protected Rect CreateRect(double x, double y, double width, double height) => Orientation == Orientation.Vertical ? new Rect(x, y, width, height) : new Rect(y, x, width, height); + } +} From 98f332dc2e53d942b253320d9d3b0816aa9e5582 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Thu, 6 Apr 2023 20:36:20 +0800 Subject: [PATCH 16/44] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E8=99=9A=E6=8B=9F=E5=8C=96=E9=98=B2=E6=AD=A2=E5=8D=A1=E9=A1=BF?= =?UTF-8?q?,=20=E5=A2=9E=E5=8A=A0=E8=87=AA=E9=80=82=E5=BA=94=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/WidthTypeEnum.cs | 2 + .../PannelCard/RightCardControl.xaml | 52 ++++++++++-------- Converts/GetWidthByWWConvert.cs | 3 + .../DraggAnimatedPanel.Drag.cs | 0 .../DraggAnimatedPanel}/DraggAnimatedPanel.cs | 0 .../VirtualizingWrapPanel}/ItemRange.cs | 2 +- .../VirtualizingWrapPanel}/ScrollDirection.cs | 2 +- .../VirtualizingWrapPanel}/SpacingMode.cs | 2 +- .../VirtualizingPanelBase.cs | 55 +++++++++++-------- .../VirtualizingWrapPanel.cs | 6 +- GeekDesk.csproj | 14 ++--- 11 files changed, 81 insertions(+), 57 deletions(-) rename {DraggAnimatedPanel => CustomComponent/DraggAnimatedPanel}/DraggAnimatedPanel.Drag.cs (100%) rename {DraggAnimatedPanel => CustomComponent/DraggAnimatedPanel}/DraggAnimatedPanel.cs (100%) rename {Util/WrpaPanel => CustomComponent/VirtualizingWrapPanel}/ItemRange.cs (90%) rename {Util/WrpaPanel => CustomComponent/VirtualizingWrapPanel}/ScrollDirection.cs (78%) rename {Util/WrpaPanel => CustomComponent/VirtualizingWrapPanel}/SpacingMode.cs (93%) rename {Util/WrpaPanel => CustomComponent/VirtualizingWrapPanel}/VirtualizingPanelBase.cs (89%) rename {Util/WrpaPanel => CustomComponent/VirtualizingWrapPanel}/VirtualizingWrapPanel.cs (99%) diff --git a/Constant/WidthTypeEnum.cs b/Constant/WidthTypeEnum.cs index 550cc78..b50130c 100644 --- a/Constant/WidthTypeEnum.cs +++ b/Constant/WidthTypeEnum.cs @@ -12,5 +12,7 @@ namespace GeekDesk.Constant RIGHT_CARD = 1, //右侧托盘宽度 RIGHT_CARD_HALF = 2, //右侧托盘宽度的一半 RIGHT_CARD_HALF_TEXT = 3, //右侧托盘宽度的一半 再减去左侧图像宽度 + RIGHT_CARD_20 = 4, //右侧托盘宽度 - 20 + RIGHT_CARD_40 = 5, //右侧托盘宽度 - 40 } } diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml index 3bbe658..5e8bea0 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml +++ b/Control/UserControls/PannelCard/RightCardControl.xaml @@ -8,7 +8,7 @@ xmlns:cvt="clr-namespace:GeekDesk.Converts" xmlns:cst="clr-namespace:GeekDesk.Constant" xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel" - xmlns:util="clr-namespace:GeekDesk.Util" + xmlns:component="clr-namespace:GeekDesk.CustomComponent.VirtualizingWrapPanel" xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF" xmlns:ot="clr-namespace:GeekDesk.Control.Other" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}" @@ -162,18 +162,20 @@ + ItemsSource="{Binding AppConfig.SelectedMenuIcons, Mode=OneWay}" + BorderThickness="0" + Padding="0,10,0,0" + ScrollViewer.CanContentScroll ="True" + VirtualizingPanel.VirtualizationMode="Recycling" + VirtualizingPanel.IsVirtualizing="True" + VirtualizingPanel.IsContainerVirtualizable="True" + VirtualizingPanel.ScrollUnit="Pixel" + > @@ -205,10 +207,13 @@ HorizontalAlignment="Center" SwapCommand="{Binding SwapCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"/>--> - @@ -291,7 +296,7 @@ - + - + Padding="0,10,0,0" + x:Name="SearchListBox" + SelectionChanged="SearchListBox_SelectionChanged" + > + Items => ((ItemContainerGenerator)ItemContainerGenerator).Items; + protected ReadOnlyCollection Items => ((ItemContainerGenerator)ItemContainerGenerator).Items; protected new IRecyclingItemContainerGenerator ItemContainerGenerator { @@ -123,7 +132,7 @@ namespace GeekDesk.Util.WrpaPanel return _itemContainerGenerator; } } - private IRecyclingItemContainerGenerator? _itemContainerGenerator; + private IRecyclingItemContainerGenerator _itemContainerGenerator; public double ExtentWidth => Extent.Width; public double ExtentHeight => Extent.Height; @@ -141,6 +150,8 @@ namespace GeekDesk.Util.WrpaPanel /// The range of items that a realized in viewport or cache. /// protected ItemRange ItemRange { get; set; } + public ScrollViewer ScrollOwner { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public DependencyObject ItemsOwner1 { get => _itemsOwner; set => _itemsOwner = value; } private Visibility previousVerticalScrollBarVisibility = Visibility.Collapsed; private Visibility previousHorizontalScrollBarVisibility = Visibility.Collapsed; @@ -174,7 +185,7 @@ namespace GeekDesk.Util.WrpaPanel if (invalidateScrollInfo) { - ScrollOwner?.InvalidateScrollInfo(); + GetScrollOwner()?.InvalidateScrollInfo(); } } @@ -245,20 +256,20 @@ namespace GeekDesk.Util.WrpaPanel { /* Sometimes when scrolling the scrollbar gets hidden without any reason. In this case the "IsMeasureValid" * property of the ScrollOwner is false. To prevent a infinite circle the mesasure call is ignored. */ - if (ScrollOwner != null) + if (GetScrollOwner() != null) { - bool verticalScrollBarGotHidden = ScrollOwner.VerticalScrollBarVisibility == ScrollBarVisibility.Auto - && ScrollOwner.ComputedVerticalScrollBarVisibility != Visibility.Visible - && ScrollOwner.ComputedVerticalScrollBarVisibility != previousVerticalScrollBarVisibility; + bool verticalScrollBarGotHidden = GetScrollOwner().VerticalScrollBarVisibility == ScrollBarVisibility.Auto + && GetScrollOwner().ComputedVerticalScrollBarVisibility != Visibility.Visible + && GetScrollOwner().ComputedVerticalScrollBarVisibility != previousVerticalScrollBarVisibility; - bool horizontalScrollBarGotHidden = ScrollOwner.HorizontalScrollBarVisibility == ScrollBarVisibility.Auto - && ScrollOwner.ComputedHorizontalScrollBarVisibility != Visibility.Visible - && ScrollOwner.ComputedHorizontalScrollBarVisibility != previousHorizontalScrollBarVisibility; + bool horizontalScrollBarGotHidden = GetScrollOwner().HorizontalScrollBarVisibility == ScrollBarVisibility.Auto + && GetScrollOwner().ComputedHorizontalScrollBarVisibility != Visibility.Visible + && GetScrollOwner().ComputedHorizontalScrollBarVisibility != previousHorizontalScrollBarVisibility; - previousVerticalScrollBarVisibility = ScrollOwner.ComputedVerticalScrollBarVisibility; - previousHorizontalScrollBarVisibility = ScrollOwner.ComputedHorizontalScrollBarVisibility; + previousVerticalScrollBarVisibility = GetScrollOwner().ComputedVerticalScrollBarVisibility; + previousHorizontalScrollBarVisibility = GetScrollOwner().ComputedHorizontalScrollBarVisibility; - if (!ScrollOwner.IsMeasureValid && verticalScrollBarGotHidden || horizontalScrollBarGotHidden) + if (!GetScrollOwner().IsMeasureValid && verticalScrollBarGotHidden || horizontalScrollBarGotHidden) { return availableSize; } @@ -397,7 +408,7 @@ namespace GeekDesk.Util.WrpaPanel offset = Extent.Height - Viewport.Height; } Offset = new Point(Offset.X, offset); - ScrollOwner?.InvalidateScrollInfo(); + GetScrollOwner()?.InvalidateScrollInfo(); InvalidateMeasure(); } @@ -412,7 +423,7 @@ namespace GeekDesk.Util.WrpaPanel offset = Extent.Width - Viewport.Width; } Offset = new Point(offset, Offset.Y); - ScrollOwner?.InvalidateScrollInfo(); + GetScrollOwner()?.InvalidateScrollInfo(); InvalidateMeasure(); } diff --git a/Util/WrpaPanel/VirtualizingWrapPanel.cs b/CustomComponent/VirtualizingWrapPanel/VirtualizingWrapPanel.cs similarity index 99% rename from Util/WrpaPanel/VirtualizingWrapPanel.cs rename to CustomComponent/VirtualizingWrapPanel/VirtualizingWrapPanel.cs index a7e26ca..85cd9c8 100644 --- a/Util/WrpaPanel/VirtualizingWrapPanel.cs +++ b/CustomComponent/VirtualizingWrapPanel/VirtualizingWrapPanel.cs @@ -11,9 +11,9 @@ using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using System.Windows; -using GeekDesk.Util.WrpaPanel; +using GeekDesk.CustomComponent.VirtualizingWrapPanel; -namespace GeekDesk.Util.WrpaPanel +namespace GeekDesk.CustomComponent.VirtualizingWrapPanel { public class VirtualizingWrapPanel : VirtualizingPanelBase { @@ -272,7 +272,7 @@ namespace GeekDesk.Util.WrpaPanel } } - private T ReadItemContainerStyle(DependencyProperty property, T fallbackValue) where T : notnull + private T ReadItemContainerStyle(DependencyProperty property, T fallbackValue) { var value = ItemsControl.ItemContainerStyle?.Setters.OfType() .FirstOrDefault(setter => setter.Property == property)?.Value; diff --git a/GeekDesk.csproj b/GeekDesk.csproj index 73fde1b..1c671d0 100644 --- a/GeekDesk.csproj +++ b/GeekDesk.csproj @@ -270,8 +270,8 @@ - - + + @@ -324,13 +324,13 @@ - - - - + + + + - + From 77a6233e6355483176608d6da9984055e2ae901b Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Thu, 6 Apr 2023 20:51:17 +0800 Subject: [PATCH 17/44] =?UTF-8?q?=E2=9C=85=20=E4=BC=98=E5=8C=96everything?= =?UTF-8?q?=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/Config/OtherControl.xaml.cs | 2 +- Plugins/EveryThing/EveryThingUtil.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Control/UserControls/Config/OtherControl.xaml.cs b/Control/UserControls/Config/OtherControl.xaml.cs index 5eb69f2..a1a886d 100644 --- a/Control/UserControls/Config/OtherControl.xaml.cs +++ b/Control/UserControls/Config/OtherControl.xaml.cs @@ -196,7 +196,7 @@ namespace GeekDesk.Control.UserControls.Config { if (MainWindow.appData.AppConfig.EnableEveryThing == true) { - EveryThingUtil.EnableEveryThing(); + EveryThingUtil.EnableEveryThing(0); } else { EveryThingUtil.DisableEveryThing(); diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index 209d0ca..4208cad 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -27,7 +27,7 @@ namespace GeekDesk.Plugins.EveryThing private static Process exeProcess = null; - public static void EnableEveryThing() + public static void EnableEveryThing(int delayTime = 2000) { string pluginsPath = Constants.PLUGINS_PATH; @@ -38,7 +38,7 @@ namespace GeekDesk.Plugins.EveryThing { try { - Thread.Sleep(2000); + Thread.Sleep(delayTime); //判断EveryThing服务是否已启动 bool enabled = false; From 058ed5016a401b39921a992e982cf6bd34ef1243 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 7 Apr 2023 16:10:29 +0800 Subject: [PATCH 18/44] =?UTF-8?q?:bug:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Util/ImageUtil.cs | 93 ++++++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/Util/ImageUtil.cs b/Util/ImageUtil.cs index 0c40f86..df57d00 100644 --- a/Util/ImageUtil.cs +++ b/Util/ImageUtil.cs @@ -204,48 +204,55 @@ namespace GeekDesk.Util try { - Image img = Image.FromFile(filePath); - if (img.Width <= tWidth && img.Height <= tHeight) + FileInfo file = new FileInfo(filePath); + if (file.Exists && file.Length > 0) { - return GetBitmapImageByFile(filePath); - } - else - { - Bitmap loBMP = new Bitmap(filePath); - ImageFormat loFormat = loBMP.RawFormat; - - decimal lnRatio; - int lnNewWidth; - int lnNewHeight; - if (loBMP.Width > loBMP.Height) + Image img = Image.FromFile(filePath); + if (img.Width <= tWidth && img.Height <= tHeight) { - lnRatio = (decimal)tWidth / loBMP.Width; - lnNewWidth = tWidth; - decimal lnTemp = loBMP.Height * lnRatio; - lnNewHeight = (int)lnTemp; + return GetBitmapImageByFile(filePath); } else { - lnRatio = (decimal)tHeight / loBMP.Height; - lnNewHeight = tHeight; - decimal lnTemp = loBMP.Width * lnRatio; - lnNewWidth = (int)lnTemp; - } - Bitmap bmpOut = new Bitmap(lnNewWidth, lnNewHeight); - Graphics g = Graphics.FromImage(bmpOut); - g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; - g.FillRectangle(System.Drawing.Brushes.White, 0, 0, lnNewWidth, lnNewHeight); - g.DrawImage(loBMP, 0, 0, lnNewWidth, lnNewHeight); - loBMP.Dispose(); - string tempPath = Constants.APP_DIR + "\\temp"; - if (File.Exists(tempPath)) - { + Bitmap loBMP = new Bitmap(filePath); + ImageFormat loFormat = loBMP.RawFormat; + + decimal lnRatio; + int lnNewWidth; + int lnNewHeight; + if (loBMP.Width > loBMP.Height) + { + lnRatio = (decimal)tWidth / loBMP.Width; + lnNewWidth = tWidth; + decimal lnTemp = loBMP.Height * lnRatio; + lnNewHeight = (int)lnTemp; + } + else + { + lnRatio = (decimal)tHeight / loBMP.Height; + lnNewHeight = tHeight; + decimal lnTemp = loBMP.Width * lnRatio; + lnNewWidth = (int)lnTemp; + } + Bitmap bmpOut = new Bitmap(lnNewWidth, lnNewHeight); + Graphics g = Graphics.FromImage(bmpOut); + g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + g.FillRectangle(System.Drawing.Brushes.White, 0, 0, lnNewWidth, lnNewHeight); + g.DrawImage(loBMP, 0, 0, lnNewWidth, lnNewHeight); + loBMP.Dispose(); + string tempPath = Constants.APP_DIR + "\\temp"; + if (File.Exists(tempPath)) + { + File.Delete(tempPath); + } + bmpOut.Save(tempPath, loFormat); + BitmapImage bm = GetBitmapImageByFile(tempPath); File.Delete(tempPath); + return bm; } - bmpOut.Save(tempPath, loFormat); - BitmapImage bm = GetBitmapImageByFile(tempPath); - File.Delete(tempPath); - return bm; + } else + { + return Base64ToBitmapImage(Constants.DEFAULT_IMG_IMAGE_BASE64); } } catch (Exception e) @@ -365,14 +372,18 @@ namespace GeekDesk.Util { try { - string strExt = Path.GetExtension(path).Substring(1); - string suffixs = "bmp,jpg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp,avif"; - string[] suffixArr = suffixs.Split(','); - foreach (string suffix in suffixArr) + string ext = Path.GetExtension(path); + if (!string.IsNullOrEmpty(ext)) { - if (suffix.Equals(strExt, StringComparison.InvariantCultureIgnoreCase)) + string strExt = Path.GetExtension(path).Substring(1); + string suffixs = "bmp,jpg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp,avif"; + string[] suffixArr = suffixs.Split(','); + foreach (string suffix in suffixArr) { - return true; + if (suffix.Equals(strExt, StringComparison.InvariantCultureIgnoreCase)) + { + return true; + } } } return false; From eba6d4770a9cbf574b8e8d26d28a1b531fcd0d79 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Wed, 12 Apr 2023 15:19:19 +0800 Subject: [PATCH 19/44] =?UTF-8?q?=E2=9C=85=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Util/ImageUtil.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Util/ImageUtil.cs b/Util/ImageUtil.cs index df57d00..f881d31 100644 --- a/Util/ImageUtil.cs +++ b/Util/ImageUtil.cs @@ -205,7 +205,8 @@ namespace GeekDesk.Util try { FileInfo file = new FileInfo(filePath); - if (file.Exists && file.Length > 0) + if (file.Exists && file.Length > 0 + && !System.IO.Path.GetExtension(filePath).Contains("psd")) { Image img = Image.FromFile(filePath); if (img.Width <= tWidth && img.Height <= tHeight) From a7181f6973d2f615bf8c79b094a6996cd1b453ca Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Thu, 13 Apr 2023 16:39:24 +0800 Subject: [PATCH 20/44] =?UTF-8?q?=F0=9F=9A=80=20=E5=87=8F=E5=B0=91everythi?= =?UTF-8?q?ng=E6=90=9C=E7=B4=A2=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/SearchResControl.xaml | 198 ++++++++ Control/Other/SearchResControl.xaml.cs | 282 ++++++++++++ .../PannelCard/RightCardControl.xaml | 169 +------ .../PannelCard/RightCardControl.xaml.cs | 424 +----------------- Converts/Visibility2BooleanConverter.cs | 10 +- GeekDesk.csproj | 8 + MainWindow.xaml | 2 + MainWindow.xaml.cs | 216 ++++++--- Plugins/EveryThing/EveryThingUtil.cs | 27 +- Util/ProcessUtil.cs | 245 ++++++++++ 10 files changed, 930 insertions(+), 651 deletions(-) create mode 100644 Control/Other/SearchResControl.xaml create mode 100644 Control/Other/SearchResControl.xaml.cs create mode 100644 Util/ProcessUtil.cs diff --git a/Control/Other/SearchResControl.xaml b/Control/Other/SearchResControl.xaml new file mode 100644 index 0000000..b4af5f9 --- /dev/null +++ b/Control/Other/SearchResControl.xaml @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Control/Other/SearchResControl.xaml.cs b/Control/Other/SearchResControl.xaml.cs new file mode 100644 index 0000000..d81c144 --- /dev/null +++ b/Control/Other/SearchResControl.xaml.cs @@ -0,0 +1,282 @@ +using GeekDesk.Constant; +using GeekDesk.Plugins.EveryThing; +using GeekDesk.Util; +using GeekDesk.ViewModel; +using GeekDesk.ViewModel.Temp; +using HandyControl.Controls; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +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; + +namespace GeekDesk.Control.Other +{ + /// + /// SearchResControl.xaml 的交互逻辑 + /// + public partial class SearchResControl : UserControl + { + public SearchResControl(ObservableCollection iconList) + { + this.DataContext = iconList; + InitializeComponent(); + } + + + + public void SearchListBoxIndexAdd() + { + //控制移动后 鼠标即使在图标上也不显示popup + RunTimeStatus.MOUSE_MOVE_COUNT = 0; + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false; + + if (SearchListBox.Items.Count > 0) + { + if (SearchListBox.SelectedIndex < SearchListBox.Items.Count - 1) + { + SearchListBox.SelectedIndex += 1; + } + } + } + + public void SearchListBoxIndexSub() + { + //控制移动后 鼠标即使在图标上也不显示popup + RunTimeStatus.MOUSE_MOVE_COUNT = 0; + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false; + + if (SearchListBox.Items.Count > 0) + { + if (SearchListBox.SelectedIndex > 0) + { + SearchListBox.SelectedIndex -= 1; + } + } + } + + public void StartupSelectionItem() + { + if (SearchListBox.SelectedItem != null) + { + IconInfo icon = SearchListBox.SelectedItem as IconInfo; + if (icon.AdminStartUp) + { + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); + } + else + { + ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP); + } + } + } + + private void SearchListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + SearchListBox.ScrollIntoView(SearchListBox.SelectedItem); + } + + + + /// + /// 查询结果ICON鼠标移动事件 + /// + /// + /// + private void SearchIcon_MouseMove(object sender, MouseEventArgs e) + { + //控制首次刷新搜索结果后, 鼠标首次移动后显示popup + RunTimeStatus.MOUSE_MOVE_COUNT++; + + //防止移动后不刷新popup content + IconInfo info = (sender as Panel).Tag as IconInfo; + MainWindow.mainWindow.RightCard.MyPoptipContent.Text = info.Content; + MainWindow.mainWindow.RightCard.MyPoptip.VerticalOffset = 30; + + if (RunTimeStatus.MOUSE_MOVE_COUNT > 1 && !RunTimeStatus.ICONLIST_MOUSE_WHEEL) + { + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true; + } + } + + /// + /// 查询结果 ICON 鼠标进入事件 + /// + /// + /// + private void SearchIcon_MouseEnter(object sender, MouseEventArgs e) + { + + //显示popup + RunTimeStatus.MOUSE_ENTER_ICON = true; + if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL) + { + new Thread(() => + { + this.Dispatcher.BeginInvoke(new Action(() => + { + IconInfo info = (sender as Panel).Tag as IconInfo; + MainWindow.mainWindow.RightCard.MyPoptipContent.Text = info.Content; + MainWindow.mainWindow.RightCard.MyPoptip.VerticalOffset = 30; + Thread.Sleep(100); + if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL && RunTimeStatus.MOUSE_MOVE_COUNT > 1) + { + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true; + } + })); + }).Start(); + } + } + + /// + /// 查询结果ICON鼠标离开事件 + /// + /// + /// + private void SearchIcon_MouseLeave(object sender, MouseEventArgs e) + { + RunTimeStatus.MOUSE_ENTER_ICON = false; + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false; + } + + /// + /// 搜索结果icon 列表鼠标滚轮预处理时间 + /// 主要使用自定义popup解决卡顿问题解决卡顿问题 + /// + /// + /// + private void VerticalIconList_PreviewMouseWheel(object sender, MouseWheelEventArgs e) + { + //控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿 + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false; + if (RunTimeStatus.ICONLIST_MOUSE_WHEEL) + { + RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500; + } + else + { + RunTimeStatus.ICONLIST_MOUSE_WHEEL = true; + + new Thread(() => + { + while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0) + { + Thread.Sleep(1); + RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1; + } + if (RunTimeStatus.MOUSE_ENTER_ICON) + { + this.Dispatcher.BeginInvoke(new Action(() => + { + MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true; + })); + } + RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100; + RunTimeStatus.ICONLIST_MOUSE_WHEEL = false; + }).Start(); + } + } + + + private void Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + if (MainWindow.appData.AppConfig.DoubleOpen) + { + IconClick(sender, e); + } + } + + private void Icon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) + { + if (!MainWindow.appData.AppConfig.DoubleOpen) + { + IconClick(sender, e); + } + } + + /// + /// 图标点击事件 + /// + /// + /// + private void IconClick(object sender, MouseButtonEventArgs e) + { + if (MainWindow.appData.AppConfig.DoubleOpen && e.ClickCount >= 2) + { + IconInfo icon = (IconInfo)((Panel)sender).Tag; + if (icon.AdminStartUp) + { + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); + } + else + { + ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP); + } + } + else if (!MainWindow.appData.AppConfig.DoubleOpen && e.ClickCount == 1) + { + IconInfo icon = (IconInfo)((Panel)sender).Tag; + if (icon.AdminStartUp) + { + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); + } + else + { + ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP); + } + } + + } + + + private static volatile bool EveryThingRuning = false; + private void VerticalCard_ScrollChanged(object sender, ScrollChangedEventArgs e) + { + if (MainWindow.appData.AppConfig.EnableEveryThing == true && EveryThingUtil.HasNext()) + { + HandyControl.Controls.ScrollViewer sv = sender as HandyControl.Controls.ScrollViewer; + if (sv.ExtentHeight - (sv.ActualHeight + sv.VerticalOffset) < 100 + && EveryThingUtil.HasNext() + && !EveryThingRuning) + { + EveryThingRuning = true; + MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Visible; + string[] split = MainWindow.mainWindow.TotalMsgBtn.Content.ToString().Split(' '); + long count = Convert.ToInt64(split[0]); + + ObservableCollection resList = this.DataContext as ObservableCollection; + + ThreadPool.QueueUserWorkItem(state => + { + ObservableCollection searchRes = EveryThingUtil.NextPage(); + this.Dispatcher.Invoke(() => + { + count += searchRes.Count; + MainWindow.mainWindow.TotalMsgBtn.Content = count + " of " + split[split.Length - 1]; + foreach (IconInfo info in searchRes) + { + resList.Add(info); + } + MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Collapsed; + EveryThingRuning = false; + }); + }); + + } + } + } + + } +} diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml index 5e8bea0..395c73a 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml +++ b/Control/UserControls/PannelCard/RightCardControl.xaml @@ -11,7 +11,6 @@ xmlns:component="clr-namespace:GeekDesk.CustomComponent.VirtualizingWrapPanel" xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF" xmlns:ot="clr-namespace:GeekDesk.Control.Other" - xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" > @@ -162,7 +161,6 @@ @@ -280,164 +278,31 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml.cs b/Control/UserControls/PannelCard/RightCardControl.xaml.cs index 3d54f10..81db405 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/RightCardControl.xaml.cs @@ -131,11 +131,11 @@ namespace GeekDesk.Control.UserControls.PannelCard IconInfo icon = (IconInfo)((Panel)sender).Tag; if (icon.AdminStartUp) { - StartIconApp(icon, IconStartType.ADMIN_STARTUP); + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); } else { - StartIconApp(icon, IconStartType.DEFAULT_STARTUP); + ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP); } } else if (!appData.AppConfig.DoubleOpen && e.ClickCount == 1) @@ -143,11 +143,11 @@ namespace GeekDesk.Control.UserControls.PannelCard IconInfo icon = (IconInfo)((Panel)sender).Tag; if (icon.AdminStartUp) { - StartIconApp(icon, IconStartType.ADMIN_STARTUP); + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); } else { - StartIconApp(icon, IconStartType.DEFAULT_STARTUP); + ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP); } } @@ -161,7 +161,7 @@ namespace GeekDesk.Control.UserControls.PannelCard private void IconAdminStart(object sender, RoutedEventArgs e) { IconInfo icon = (IconInfo)((MenuItem)sender).Tag; - StartIconApp(icon, IconStartType.ADMIN_STARTUP); + ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP); } /// @@ -172,227 +172,7 @@ namespace GeekDesk.Control.UserControls.PannelCard private void ShowInExplore(object sender, RoutedEventArgs e) { IconInfo icon = (IconInfo)((MenuItem)sender).Tag; - StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE); - } - - private void StartIconApp(IconInfo icon, IconStartType type, bool useRelativePath = false) - { - try - { - using (Process p = new Process()) - { - string startArg = icon.StartArg; - - if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg)) - { - StartSystemApp(startArg, type); - } - else - { - string path; - if (useRelativePath) - { - string fullPath = Path.Combine(Constants.APP_DIR, icon.RelativePath); - path = Path.GetFullPath(fullPath); - } - else - { - path = icon.Path; - } - p.StartInfo.FileName = path; - if (!StringUtil.IsEmpty(startArg)) - { - p.StartInfo.Arguments = startArg; - } - if (icon.IconType == IconType.OTHER) - { - if (!File.Exists(path) && !Directory.Exists(path)) - { - //如果没有使用相对路径 那么使用相对路径启动一次 - if (!useRelativePath) - { - StartIconApp(icon, type, true); - return; - } - else - { - HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!"); - return; - } - } - p.StartInfo.WorkingDirectory = path.Substring(0, path.LastIndexOf("\\")); - switch (type) - { - case IconStartType.ADMIN_STARTUP: - //p.StartInfo.Arguments = "1";//启动参数 - p.StartInfo.Verb = "runas"; - //p.StartInfo.CreateNoWindow = false; //设置显示窗口 - p.StartInfo.UseShellExecute = true;//不使用操作系统外壳程序启动进程 - //p.StartInfo.ErrorDialog = false; - if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) - { - //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 - if (appData.AppConfig.MarginHide) - { - if (!MarginHide.IsMargin()) - { - MainWindow.HideApp(); - } - } - else - { - MainWindow.HideApp(); - } - - } - break;// c#好像不能case穿透 - case IconStartType.DEFAULT_STARTUP: - if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) - { - //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 - if (appData.AppConfig.MarginHide) - { - if (!MarginHide.IsMargin()) - { - MainWindow.HideApp(); - } - } - else - { - MainWindow.HideApp(); - } - } - break; - case IconStartType.SHOW_IN_EXPLORE: - p.StartInfo.FileName = "Explorer.exe"; - p.StartInfo.Arguments = "/e,/select," + icon.Path; - break; - } - } - else - { - if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) - { - //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 - if (appData.AppConfig.MarginHide) - { - if (!MarginHide.IS_HIDE) - { - MainWindow.HideApp(); - } - } - else - { - MainWindow.HideApp(); - } - } - } - p.Start(); - if (useRelativePath) - { - //如果使用相对路径启动成功 那么重新设置程序绝对路径 - icon.Path = path; - } - } - } - icon.Count++; - - //隐藏搜索框 - if (RunTimeStatus.SEARCH_BOX_SHOW) - { - MainWindow.mainWindow.HidedSearchBox(); - } - } - catch (Exception e) - { - if (!useRelativePath) - { - StartIconApp(icon, type, true); - } - else - { - HandyControl.Controls.Growl.WarningGlobal("程序启动失败(可能为不支持的启动方式)!"); - LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type); - } - } - } - - - - private void StartSystemApp(string startArg, IconStartType type) - { - if (type == IconStartType.SHOW_IN_EXPLORE) - { - Growl.WarningGlobal("系统项目不支持打开文件位置操作!"); - return; - } - switch (startArg) - { - case "Calculator": - Process.Start("calc.exe"); - break; - case "Computer": - Process.Start("explorer.exe"); - break; - case "GroupPolicy": - Process.Start("gpedit.msc"); - break; - case "Notepad": - Process.Start("notepad"); - break; - case "Network": - Process.Start("ncpa.cpl"); - break; - case "RecycleBin": - Process.Start("shell:RecycleBinFolder"); - break; - case "Registry": - Process.Start("regedit.exe"); - break; - case "Mstsc": - if (type == IconStartType.ADMIN_STARTUP) - { - Process.Start("mstsc", "-admin"); - } - else - { - Process.Start("mstsc"); - } - break; - case "Control": - Process.Start("Control"); - break; - case "CMD": - if (type == IconStartType.ADMIN_STARTUP) - { - using (Process process = new Process()) - { - process.StartInfo.FileName = "cmd.exe"; - process.StartInfo.Verb = "runas"; - process.Start(); - } - } - else - { - Process.Start("cmd"); - } - break; - case "Services": - Process.Start("services.msc"); - break; - } - //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 - if (appData.AppConfig.MarginHide) - { - if (!MarginHide.IS_HIDE) - { - MainWindow.HideApp(); - } - } - else - { - MainWindow.HideApp(); - } + ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE); } /// @@ -778,56 +558,7 @@ namespace GeekDesk.Control.UserControls.PannelCard } } - public void SearchListBoxIndexAdd() - { - //控制移动后 鼠标即使在图标上也不显示popup - RunTimeStatus.MOUSE_MOVE_COUNT = 0; - MyPoptip.IsOpen = false; - - if (SearchListBox.Items.Count > 0) - { - if (SearchListBox.SelectedIndex < SearchListBox.Items.Count - 1) - { - SearchListBox.SelectedIndex += 1; - } - } - } - - public void SearchListBoxIndexSub() - { - //控制移动后 鼠标即使在图标上也不显示popup - RunTimeStatus.MOUSE_MOVE_COUNT = 0; - MyPoptip.IsOpen = false; - - if (SearchListBox.Items.Count > 0) - { - if (SearchListBox.SelectedIndex > 0) - { - SearchListBox.SelectedIndex -= 1; - } - } - } - - public void StartupSelectionItem() - { - if (SearchListBox.SelectedItem != null) - { - IconInfo icon = SearchListBox.SelectedItem as IconInfo; - if (icon.AdminStartUp) - { - StartIconApp(icon, IconStartType.ADMIN_STARTUP); - } - else - { - StartIconApp(icon, IconStartType.DEFAULT_STARTUP); - } - } - } - - private void SearchListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - SearchListBox.ScrollIntoView(SearchListBox.SelectedItem); - } + private void PDDialog_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { @@ -937,105 +668,6 @@ namespace GeekDesk.Control.UserControls.PannelCard } - /// - /// 搜索结果icon 列表鼠标滚轮预处理时间 - /// 主要使用自定义popup解决卡顿问题解决卡顿问题 - /// - /// - /// - private void VerticalIconList_PreviewMouseWheel(object sender, MouseWheelEventArgs e) - { - //控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿 - MyPoptip.IsOpen = false; - if (RunTimeStatus.ICONLIST_MOUSE_WHEEL) - { - RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500; - } - else - { - RunTimeStatus.ICONLIST_MOUSE_WHEEL = true; - - new Thread(() => - { - while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0) - { - Thread.Sleep(1); - RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1; - } - if (RunTimeStatus.MOUSE_ENTER_ICON) - { - this.Dispatcher.BeginInvoke(new Action(() => - { - MyPoptip.IsOpen = true; - })); - } - RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100; - RunTimeStatus.ICONLIST_MOUSE_WHEEL = false; - }).Start(); - } - } - - /// - /// 查询结果 ICON 鼠标进入事件 - /// - /// - /// - private void SearchIcon_MouseEnter(object sender, MouseEventArgs e) - { - - //显示popup - RunTimeStatus.MOUSE_ENTER_ICON = true; - if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL) - { - new Thread(() => - { - this.Dispatcher.BeginInvoke(new Action(() => - { - IconInfo info = (sender as Panel).Tag as IconInfo; - MyPoptipContent.Text = info.Content; - MyPoptip.VerticalOffset = 30; - Thread.Sleep(100); - if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL && RunTimeStatus.MOUSE_MOVE_COUNT > 1) - { - MyPoptip.IsOpen = true; - } - })); - }).Start(); - } - } - - /// - /// 查询结果ICON鼠标离开事件 - /// - /// - /// - private void SearchIcon_MouseLeave(object sender, MouseEventArgs e) - { - RunTimeStatus.MOUSE_ENTER_ICON = false; - MyPoptip.IsOpen = false; - } - - /// - /// 查询结果ICON鼠标移动事件 - /// - /// - /// - private void SearchIcon_MouseMove(object sender, MouseEventArgs e) - { - //控制首次刷新搜索结果后, 鼠标首次移动后显示popup - RunTimeStatus.MOUSE_MOVE_COUNT++; - - //防止移动后不刷新popup content - IconInfo info = (sender as Panel).Tag as IconInfo; - MyPoptipContent.Text = info.Content; - MyPoptip.VerticalOffset = 30; - - if (RunTimeStatus.MOUSE_MOVE_COUNT > 1 && !RunTimeStatus.ICONLIST_MOUSE_WHEEL) - { - MyPoptip.IsOpen = true; - } - } - /// /// menu结果ICON鼠标移动事件 /// @@ -1049,48 +681,6 @@ namespace GeekDesk.Control.UserControls.PannelCard MyPoptip.VerticalOffset = 30; } - private void VerticalCard_ScrollChanged(object sender, ScrollChangedEventArgs e) - { - if (appData.AppConfig.EnableEveryThing == true && EveryThingUtil.HasNext()) - { - HandyControl.Controls.ScrollViewer sv = sender as HandyControl.Controls.ScrollViewer; - if (sv.ExtentHeight - (sv.ActualHeight + sv.VerticalOffset) < 200 && EveryThingUtil.HasNext()) - { - string[] split = MainWindow.mainWindow.TotalMsgBtn.Content.ToString().Split(' '); - long count = Convert.ToInt64(split[0]); - ObservableCollection iconBakList = EveryThingUtil.NextPage(); - count += iconBakList.Count; - - this.Dispatcher.Invoke(() => - { - MainWindow.mainWindow.TotalMsgBtn.Content = count + " of " + split[split.Length - 1]; - foreach (IconInfo icon in iconBakList) - { - if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; - SearchIconList.IconList.Add(icon); - } - }); - //异步加载图标 - if (iconBakList != null && iconBakList.Count > 0) - { - ThreadPool.QueueUserWorkItem(state => - { - foreach (IconInfo icon in iconBakList) - { - if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; - this.Dispatcher.Invoke(() => - { - icon.BitmapImage_NoWrite = ImageUtil.GetBitmapIconByUnknownPath(icon.Path); - }); - } - }); - } - - } - } - } - - } } diff --git a/Converts/Visibility2BooleanConverter.cs b/Converts/Visibility2BooleanConverter.cs index 3d941c8..c32e508 100644 --- a/Converts/Visibility2BooleanConverter.cs +++ b/Converts/Visibility2BooleanConverter.cs @@ -9,14 +9,14 @@ namespace GeekDesk.Converts { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if ((Visibility)value == Visibility.Visible) + if (parameter == null) { - return true; - } - else + return (Visibility)value == Visibility.Visible; + } else { - return false; + return !((Visibility)value == Visibility.Visible); } + } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/GeekDesk.csproj b/GeekDesk.csproj index 1c671d0..c5f9d2f 100644 --- a/GeekDesk.csproj +++ b/GeekDesk.csproj @@ -200,6 +200,9 @@ IconInfoUrlDialog.xaml + + SearchResControl.xaml + OtherControl.xaml @@ -315,6 +318,7 @@ + @@ -369,6 +373,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/MainWindow.xaml b/MainWindow.xaml index ab250c8..de1d33d 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -11,6 +11,7 @@ xmlns:cvt="clr-namespace:GeekDesk.Converts" x:Name="AppWindow" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" + xmlns:my="clr-namespace:GeekDesk.Util" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}" Title="GeekDesk_Main_8400A17AEEF7C029" MinWidth="600" @@ -196,6 +197,7 @@ + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 1de0ddf..5073c46 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -1,4 +1,5 @@ using GeekDesk.Constant; +using GeekDesk.Control.Other; using GeekDesk.Control.UserControls.Config; using GeekDesk.Control.UserControls.PannelCard; using GeekDesk.Control.Windows; @@ -124,24 +125,30 @@ namespace GeekDesk RightCard.MyPoptip.IsOpen = false; string inputText = SearchBox.Text.ToLower(); - RightCard.VerticalUFG.Visibility = Visibility.Collapsed; if (!string.IsNullOrEmpty(inputText)) { RunTimeStatus.EVERYTHING_SEARCH_DELAY_TIME = 300; if (!RunTimeStatus.EVERYTHING_NEW_SEARCH) { RunTimeStatus.EVERYTHING_NEW_SEARCH = true; + object obj = RightCard.VerticalCard.Content; + if (obj != null) + { + SearchResControl control = obj as SearchResControl; + control.VerticalUFG.Visibility = Visibility.Collapsed; + } SearchDelay(); } } else { - new Thread(() => + //清空查询结果 + object obj = RightCard.VerticalCard.Content; + if (obj != null) { - this.Dispatcher.Invoke(() => - { - SearchIconList.RemoveAll(); - }); - }).Start(); + SearchResControl control = obj as SearchResControl; + control.VerticalUFG.Visibility = Visibility.Collapsed; + control.SearchListBox.Items.Clear(); + } } } @@ -162,77 +169,149 @@ namespace GeekDesk 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) + new Thread(() => { - ObservableCollection iconList = menu.IconList; - foreach (IconInfo icon in iconList) + ObservableCollection resList = new ObservableCollection(); + + DateTime bf = DateTime.Now; + ObservableCollection iconBakList = EveryThingUtil.Search(inputText); + + foreach (IconInfo icon in iconBakList) { - if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; - string pyName = Pinyin.GetInitials(icon.Name).ToLower(); - if (icon.Name.Contains(inputText) || pyName.Contains(inputText)) + resList.Add(icon); + } + + DateTime af = DateTime.Now; + + //GeekDesk数据搜索 + ObservableCollection menuList = appData.MenuList; + foreach (MenuInfo menu in menuList) + { + ObservableCollection iconList = menu.IconList; + foreach (IconInfo icon in iconList) { - SearchIconList.IconList.Add(icon); - count++; + if (RunTimeStatus.EVERYTHING_NEW_SEARCH) return; + string pyName = Pinyin.GetInitials(icon.Name).ToLower(); + if (icon.Name.Contains(inputText) || pyName.Contains(inputText)) + { + resList.Add(icon); + } } } - } + Console.WriteLine("查询耗时:{0}ms.", af.Subtract(bf).TotalMilliseconds); - - if (appData.AppConfig.EnableEveryThing == true) - { - new Thread(() => + this.Dispatcher.Invoke(() => { - //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(); - } + SearchResControl control = new SearchResControl(resList); + bf = DateTime.Now; + RightCard.VerticalCard.Content = control; + //显示加载效果 + RightCard.Loading_RightCard.Visibility = Visibility.Collapsed; + af = DateTime.Now; + Console.WriteLine("渲染耗时:{0}ms.", af.Subtract(bf).TotalMilliseconds); + }); + }).Start(); + - if (RightCard.SearchListBox.Items.Count > 0) - { - RightCard.SearchListBox.SelectedIndex = 0; - } - RightCard.VerticalUFG.Visibility = Visibility.Visible; + ////异步加载图标 + //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(); } @@ -880,15 +959,18 @@ namespace GeekDesk { if (e.Key == Key.Down || e.Key == Key.Tab) { - RightCard.SearchListBoxIndexAdd(); + SearchResControl res = RightCard.VerticalCard.Content as SearchResControl; + res.SearchListBoxIndexAdd(); } else if (e.Key == Key.Up) { - RightCard.SearchListBoxIndexSub(); + SearchResControl res = RightCard.VerticalCard.Content as SearchResControl; + res.SearchListBoxIndexSub(); } else if (e.Key == Key.Enter) { - RightCard.StartupSelectionItem(); + SearchResControl res = RightCard.VerticalCard.Content as SearchResControl; + res.StartupSelectionItem(); } } } diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index 4208cad..329318d 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Drawing; using System.Linq; using System.Text; using System.Threading; @@ -92,19 +93,25 @@ namespace GeekDesk.Plugins.EveryThing public static void DisableEveryThing() { - if (IsByGeekDesk) + try { - if (Environment.Is64BitOperatingSystem) + if (IsByGeekDesk) { - EveryThing64.Everything_Exit(); - } else - { - EveryThing32.Everything_Exit(); + if (Environment.Is64BitOperatingSystem) + { + EveryThing64.Everything_Exit(); + } + else + { + EveryThing32.Everything_Exit(); + } } + if (exeProcess != null) exeProcess.Kill(); + if (serviceProcess != null) serviceProcess.Kill(); + } catch (Exception e) + { + LogUtil.WriteErrorLog(e); } - if (exeProcess != null) exeProcess.Kill(); - if (serviceProcess != null) serviceProcess.Kill(); - } @@ -179,7 +186,7 @@ namespace GeekDesk.Plugins.EveryThing { Path_NoWrite = filePath, LnkPath_NoWrite = tempPath, - BitmapImage_NoWrite = null, + BitmapImage_NoWrite = ImageUtil.GetBitmapIconByUnknownPath(filePath), StartArg_NoWrite = FileUtil.GetArgByLnk(tempPath), Name_NoWrite = name, }; diff --git a/Util/ProcessUtil.cs b/Util/ProcessUtil.cs new file mode 100644 index 0000000..9581de5 --- /dev/null +++ b/Util/ProcessUtil.cs @@ -0,0 +1,245 @@ +using GeekDesk.Constant; +using GeekDesk.ViewModel; +using HandyControl.Controls; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GeekDesk.Util +{ + public class ProcessUtil + { + + + public static void StartIconApp(IconInfo icon, IconStartType type, bool useRelativePath = false) + { + App.Current.Dispatcher.Invoke(() => + { + + try + { + using (Process p = new Process()) + { + string startArg = icon.StartArg; + + if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg)) + { + StartSystemApp(startArg, type); + } + else + { + string path; + if (useRelativePath) + { + string fullPath = Path.Combine(Constants.APP_DIR, icon.RelativePath); + path = Path.GetFullPath(fullPath); + } + else + { + path = icon.Path; + } + p.StartInfo.FileName = path; + if (!StringUtil.IsEmpty(startArg)) + { + p.StartInfo.Arguments = startArg; + } + if (icon.IconType == IconType.OTHER) + { + if (!File.Exists(path) && !Directory.Exists(path)) + { + //如果没有使用相对路径 那么使用相对路径启动一次 + if (!useRelativePath) + { + StartIconApp(icon, type, true); + return; + } + else + { + HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!"); + return; + } + } + p.StartInfo.WorkingDirectory = path.Substring(0, path.LastIndexOf("\\")); + switch (type) + { + case IconStartType.ADMIN_STARTUP: + //p.StartInfo.Arguments = "1";//启动参数 + p.StartInfo.Verb = "runas"; + //p.StartInfo.CreateNoWindow = false; //设置显示窗口 + p.StartInfo.UseShellExecute = true;//不使用操作系统外壳程序启动进程 + //p.StartInfo.ErrorDialog = false; + if (MainWindow.appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) + { + //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 + if (MainWindow.appData.AppConfig.MarginHide) + { + if (!MarginHide.IsMargin()) + { + MainWindow.HideApp(); + } + } + else + { + MainWindow.HideApp(); + } + + } + break;// c#好像不能case穿透 + case IconStartType.DEFAULT_STARTUP: + if (MainWindow.appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) + { + //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 + if (MainWindow.appData.AppConfig.MarginHide) + { + if (!MarginHide.IsMargin()) + { + MainWindow.HideApp(); + } + } + else + { + MainWindow.HideApp(); + } + } + break; + case IconStartType.SHOW_IN_EXPLORE: + p.StartInfo.FileName = "Explorer.exe"; + p.StartInfo.Arguments = "/e,/select," + icon.Path; + break; + } + } + else + { + if (MainWindow.appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL) + { + //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 + if (MainWindow.appData.AppConfig.MarginHide) + { + if (!MarginHide.IS_HIDE) + { + MainWindow.HideApp(); + } + } + else + { + MainWindow.HideApp(); + } + } + } + p.Start(); + if (useRelativePath) + { + //如果使用相对路径启动成功 那么重新设置程序绝对路径 + icon.Path = path; + } + } + } + icon.Count++; + + //隐藏搜索框 + if (RunTimeStatus.SEARCH_BOX_SHOW) + { + MainWindow.mainWindow.HidedSearchBox(); + } + } + catch (Exception e) + { + if (!useRelativePath) + { + StartIconApp(icon, type, true); + } + else + { + HandyControl.Controls.Growl.WarningGlobal("程序启动失败(可能为不支持的启动方式)!"); + LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type); + } + } + }); + } + + + + private static void StartSystemApp(string startArg, IconStartType type) + { + if (type == IconStartType.SHOW_IN_EXPLORE) + { + Growl.WarningGlobal("系统项目不支持打开文件位置操作!"); + return; + } + switch (startArg) + { + case "Calculator": + Process.Start("calc.exe"); + break; + case "Computer": + Process.Start("explorer.exe"); + break; + case "GroupPolicy": + Process.Start("gpedit.msc"); + break; + case "Notepad": + Process.Start("notepad"); + break; + case "Network": + Process.Start("ncpa.cpl"); + break; + case "RecycleBin": + Process.Start("shell:RecycleBinFolder"); + break; + case "Registry": + Process.Start("regedit.exe"); + break; + case "Mstsc": + if (type == IconStartType.ADMIN_STARTUP) + { + Process.Start("mstsc", "-admin"); + } + else + { + Process.Start("mstsc"); + } + break; + case "Control": + Process.Start("Control"); + break; + case "CMD": + if (type == IconStartType.ADMIN_STARTUP) + { + using (Process process = new Process()) + { + process.StartInfo.FileName = "cmd.exe"; + process.StartInfo.Verb = "runas"; + process.Start(); + } + } + else + { + Process.Start("cmd"); + } + break; + case "Services": + Process.Start("services.msc"); + break; + } + //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口 + if (MainWindow.appData.AppConfig.MarginHide) + { + if (!MarginHide.IS_HIDE) + { + MainWindow.HideApp(); + } + } + else + { + MainWindow.HideApp(); + } + } + + + + } +} From 41799251afd11425d1a4ffa191bd251b7cc66694 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 14 Apr 2023 13:48:50 +0800 Subject: [PATCH 21/44] =?UTF-8?q?=E2=9C=85=20=E4=BC=98=E5=8C=96everything?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserControls/Config/OtherControl.xaml.cs | 2 +- .../PannelCard/LeftCardControl.xaml.cs | 11 +- .../PannelCard/RightCardControl.xaml | 6 +- GeekDesk.csproj | 2 + MainWindow.xaml.cs | 26 ++-- Plugins/EveryThing/EveryThingUtil.cs | 147 ++++++++++++------ Util/ProcessUtil.cs | 32 ++++ 7 files changed, 155 insertions(+), 71 deletions(-) diff --git a/Control/UserControls/Config/OtherControl.xaml.cs b/Control/UserControls/Config/OtherControl.xaml.cs index a1a886d..2e95c18 100644 --- a/Control/UserControls/Config/OtherControl.xaml.cs +++ b/Control/UserControls/Config/OtherControl.xaml.cs @@ -199,7 +199,7 @@ namespace GeekDesk.Control.UserControls.Config EveryThingUtil.EnableEveryThing(0); } else { - EveryThingUtil.DisableEveryThing(); + EveryThingUtil.DisableEveryThing(true); } } } diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs index f0d1abb..555a25e 100644 --- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs @@ -244,7 +244,7 @@ namespace GeekDesk.Control.UserControls.PannelCard object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex); SetListBoxItemEvent((ListBoxItem)obj); Lbi_Selected(obj, null); - HandyControl.Controls.Growl.Success("菜单关联成功, 后台加载列表!", "MainWindowGrowl"); + HandyControl.Controls.Growl.Success("菜单关联成功, 加载列表中, 稍后重新进入此菜单可查看列表!", "MainWindowGrowl"); FileWatcher.LinkMenuWatcher(menuInfo); new Thread(() => @@ -260,10 +260,11 @@ namespace GeekDesk.Control.UserControls.PannelCard } this.Dispatcher.Invoke(() => { - foreach (IconInfo iconInfo in iconList) - { - menuInfo.IconList.Add(iconInfo); - } + menuInfo.IconList = iconList; + //foreach (IconInfo iconInfo in iconList) + //{ + // menuInfo.IconList = iconList; + //} }); }).Start(); diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml index 395c73a..b6e1da2 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml +++ b/Control/UserControls/PannelCard/RightCardControl.xaml @@ -13,6 +13,7 @@ xmlns:ot="clr-namespace:GeekDesk.Control.Other" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" + AllowDrop="True" > @@ -280,7 +281,7 @@ + Visibility="Collapsed" + /> diff --git a/GeekDesk.csproj b/GeekDesk.csproj index c5f9d2f..f99f8b2 100644 --- a/GeekDesk.csproj +++ b/GeekDesk.csproj @@ -108,6 +108,7 @@ packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + packages\System.Diagnostics.DiagnosticSource.4.7.1\lib\net46\System.Diagnostics.DiagnosticSource.dll @@ -131,6 +132,7 @@ packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 5073c46..d3082e7 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -131,6 +131,8 @@ namespace GeekDesk if (!RunTimeStatus.EVERYTHING_NEW_SEARCH) { RunTimeStatus.EVERYTHING_NEW_SEARCH = true; + //显示搜索结果列表 + RightCard.VisibilitySearchCard(Visibility.Visible); object obj = RightCard.VerticalCard.Content; if (obj != null) { @@ -175,16 +177,15 @@ namespace GeekDesk { ObservableCollection resList = new ObservableCollection(); - DateTime bf = DateTime.Now; - ObservableCollection iconBakList = EveryThingUtil.Search(inputText); - - foreach (IconInfo icon in iconBakList) + if (appData.AppConfig.EnableEveryThing == true) { - resList.Add(icon); + ObservableCollection iconBakList = EveryThingUtil.Search(inputText); + foreach (IconInfo icon in iconBakList) + { + resList.Add(icon); + } } - DateTime af = DateTime.Now; - //GeekDesk数据搜索 ObservableCollection menuList = appData.MenuList; foreach (MenuInfo menu in menuList) @@ -200,17 +201,17 @@ namespace GeekDesk } } } - Console.WriteLine("查询耗时:{0}ms.", af.Subtract(bf).TotalMilliseconds); this.Dispatcher.Invoke(() => { + if (appData.AppConfig.EnableEveryThing == true) + { + TotalMsgBtn.Visibility = Visibility.Visible; + } SearchResControl control = new SearchResControl(resList); - bf = DateTime.Now; RightCard.VerticalCard.Content = control; //显示加载效果 RightCard.Loading_RightCard.Visibility = Visibility.Collapsed; - af = DateTime.Now; - Console.WriteLine("渲染耗时:{0}ms.", af.Subtract(bf).TotalMilliseconds); }); }).Start(); @@ -338,9 +339,8 @@ namespace GeekDesk SearchBox.Width = 0; TotalMsgBtn.Content = "0 of 0"; TotalMsgBtn.Visibility = Visibility.Hidden; + RightCard.VerticalCard.Content = null; RightCard.VisibilitySearchCard(Visibility.Collapsed); - - SearchIconList.RemoveAll(); }); }).Start(); } diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index 329318d..bfea1b8 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -3,11 +3,14 @@ using GeekDesk.Plugins.EveryThing.Constant; using GeekDesk.Util; using GeekDesk.ViewModel; using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Configuration.Install; using System.Diagnostics; using System.Drawing; using System.Linq; +using System.ServiceProcess; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -17,69 +20,58 @@ namespace GeekDesk.Plugins.EveryThing public class EveryThingUtil { - //检查是否是由GeekDesk启动的EveryThing - private static bool IsByGeekDesk = true; //每次加载20条 private static long pageCount = 20; private static UInt32 ui = 0; - private static Process serviceProcess = null; - private static Process exeProcess = null; - - public static void EnableEveryThing(int delayTime = 2000) { string pluginsPath = Constants.PLUGINS_PATH; bool Is64Bit = Environment.Is64BitOperatingSystem; string everyThingPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe"; - + string installUtilPath = "C:\\Windows\\Microsoft.NET\\Framework"+ (Is64Bit ? "64" : "") + "\\v4.0.30319\\InstallUtil.exe"; new Thread(() => { try { Thread.Sleep(delayTime); - //判断EveryThing服务是否已启动 - bool enabled = false; - Process[] processList = Process.GetProcesses(); - foreach (System.Diagnostics.Process process in processList) + //判断EveryThing服务是否存在 + ServiceController sc = GetService("Everything"); + if (sc != null) { - if (process.ProcessName.ToUpper().Equals("EVERYTHING")) + //判断是否启动 + if (sc.Status != ServiceControllerStatus.StartPending + && sc.Status != ServiceControllerStatus.Running) { - enabled = true; - IsByGeekDesk = false; - break; + //启动服务 + EveryThingService(ServiceType.START); } - } - if (!enabled) + } else { - //启动服务 - serviceProcess = new Process(); - serviceProcess.StartInfo.FileName = everyThingPath; - serviceProcess.StartInfo.UseShellExecute = true; - serviceProcess.StartInfo.Verb = "runas"; - serviceProcess.StartInfo.Arguments = " -svc"; - serviceProcess.Start(); + //安装服务 + EveryThingService(ServiceType.INSTALL); } Thread.Sleep(2000); - processList = Process.GetProcesses(); - //启动程序 - exeProcess = new Process(); - exeProcess.StartInfo.FileName = everyThingPath; - exeProcess.Start(); - int waitTime = 5000; - while (true && waitTime > 0) + if (GetService("Everything") != null) { - Thread.Sleep(100); - waitTime -= 100; - exeProcess.CloseMainWindow(); + //启动程序 + Process exeProcess = new Process(); + exeProcess.StartInfo.FileName = everyThingPath; + exeProcess.Start(); + int waitTime = 5000; + while (true && waitTime > 0) + { + Thread.Sleep(100); + waitTime -= 100; + exeProcess.CloseMainWindow(); + } } - } catch (Exception e) { @@ -89,29 +81,84 @@ namespace GeekDesk.Plugins.EveryThing } + enum ServiceType + { + START, + STOP, + INSTALL, + UNINSTALL + } + private static void EveryThingService(ServiceType type) + { + string pluginsPath = Constants.PLUGINS_PATH; + bool Is64Bit = Environment.Is64BitOperatingSystem; + string everyThingPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe"; + string installUtilPath = "C:\\Windows\\Microsoft.NET\\Framework" + (Is64Bit ? "64" : "") + "\\v4.0.30319\\InstallUtil.exe"; + + Process p = new Process(); + p.StartInfo.FileName = everyThingPath; + string arg; + switch(type) + { + default: + arg = "-start-service"; + break; + case ServiceType.STOP: + arg = "-stop-service"; + break; + case ServiceType.INSTALL: + arg = "-install-service"; + break; + case ServiceType.UNINSTALL: + arg = "-uninstall-service"; + break; + } + p.StartInfo.Arguments = arg; + p.Start(); + } - public static void DisableEveryThing() + public static ServiceController GetService(string serviceName) + { + ServiceController[] services = ServiceController.GetServices(); + foreach (ServiceController s in services) + { + if (s.ServiceName.ToLower().Equals(serviceName.ToLower())) + { + return s; + } + } + return null; + } + + + + + public static void DisableEveryThing(bool uninstall = false) { try { - if (IsByGeekDesk) + if (Environment.Is64BitOperatingSystem) { - if (Environment.Is64BitOperatingSystem) - { - EveryThing64.Everything_Exit(); - } - else - { - EveryThing32.Everything_Exit(); - } + EveryThing64.Everything_Exit(); + } + else + { + EveryThing32.Everything_Exit(); } - if (exeProcess != null) exeProcess.Kill(); - if (serviceProcess != null) serviceProcess.Kill(); - } catch (Exception e) - { - LogUtil.WriteErrorLog(e); } + catch (Exception e) { } + try + { + if (uninstall) + { + EveryThingService(ServiceType.UNINSTALL); + } else + { + EveryThingService(ServiceType.STOP); + } + } + catch (Exception e) { } } diff --git a/Util/ProcessUtil.cs b/Util/ProcessUtil.cs index 9581de5..278c935 100644 --- a/Util/ProcessUtil.cs +++ b/Util/ProcessUtil.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; @@ -240,6 +241,37 @@ namespace GeekDesk.Util } + [Flags] + private enum ProcessAccessFlags : uint + { + QueryLimitedInformation = 0x00001000 + } + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern bool QueryFullProcessImageName( + [In] IntPtr hProcess, + [In] int dwFlags, + [Out] StringBuilder lpExeName, + ref int lpdwSize); + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern IntPtr OpenProcess( + ProcessAccessFlags processAccess, + bool bInheritHandle, + int processId); + + public static String GetProcessFilename(Process p) + { + int capacity = 2000; + StringBuilder builder = new StringBuilder(capacity); + IntPtr ptr = OpenProcess(ProcessAccessFlags.QueryLimitedInformation, false, p.Id); + if (!QueryFullProcessImageName(ptr, 0, builder, ref capacity)) + { + return String.Empty; + } + return builder.ToString(); + } + } } From 29bb799f11334f26a2c969f3d20f299650f71daa Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 14 Apr 2023 14:26:42 +0800 Subject: [PATCH 22/44] =?UTF-8?q?=E2=9C=85=20=E4=BC=98=E5=8C=96=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BAUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/SearchResControl.xaml.cs | 4 ++-- MainWindow.xaml | 17 +++++++++-------- MainWindow.xaml.cs | 11 ++++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Control/Other/SearchResControl.xaml.cs b/Control/Other/SearchResControl.xaml.cs index d81c144..9d8ffea 100644 --- a/Control/Other/SearchResControl.xaml.cs +++ b/Control/Other/SearchResControl.xaml.cs @@ -253,7 +253,7 @@ namespace GeekDesk.Control.Other { EveryThingRuning = true; MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Visible; - string[] split = MainWindow.mainWindow.TotalMsgBtn.Content.ToString().Split(' '); + string[] split = MainWindow.mainWindow.SearchResText.Text.Split(' '); long count = Convert.ToInt64(split[0]); ObservableCollection resList = this.DataContext as ObservableCollection; @@ -264,7 +264,7 @@ namespace GeekDesk.Control.Other this.Dispatcher.Invoke(() => { count += searchRes.Count; - MainWindow.mainWindow.TotalMsgBtn.Content = count + " of " + split[split.Length - 1]; + MainWindow.mainWindow.SearchResText.Text = count + " of " + split[split.Length - 1]; foreach (IconInfo info in searchRes) { resList.Add(info); diff --git a/MainWindow.xaml b/MainWindow.xaml index de1d33d..3b24513 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -142,16 +142,16 @@ - + + + { string inputText = SearchBox.Text.ToLower().Trim(); @@ -179,7 +179,7 @@ namespace GeekDesk if (appData.AppConfig.EnableEveryThing == true) { - ObservableCollection iconBakList = EveryThingUtil.Search(inputText); + ObservableCollection iconBakList = EveryThingUtil.Search(inputText); foreach (IconInfo icon in iconBakList) { resList.Add(icon); @@ -206,7 +206,8 @@ namespace GeekDesk { if (appData.AppConfig.EnableEveryThing == true) { - TotalMsgBtn.Visibility = Visibility.Visible; + SearchResText.Text = resList.Count + " of " + Convert.ToInt32(EveryThingUtil.Everything_GetNumResults()); + SearchResContainer.Visibility = Visibility.Visible; } SearchResControl control = new SearchResControl(resList); RightCard.VerticalCard.Content = control; @@ -337,8 +338,8 @@ namespace GeekDesk SearchBox.Clear(); SearchBox.TextChanged += SearchBox_TextChanged; SearchBox.Width = 0; - TotalMsgBtn.Content = "0 of 0"; - TotalMsgBtn.Visibility = Visibility.Hidden; + SearchResText.Text = "0 of 0"; + SearchResContainer.Visibility = Visibility.Collapsed; RightCard.VerticalCard.Content = null; RightCard.VisibilitySearchCard(Visibility.Collapsed); }); From c34142923cd284c08070da694dc738537062c266 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 14 Apr 2023 17:44:39 +0800 Subject: [PATCH 23/44] =?UTF-8?q?=F0=9F=A7=A1=E4=BC=98=E5=8C=96=E6=8B=BE?= =?UTF-8?q?=E8=89=B2=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Windows/GlobalColorPickerWindow.xaml | 65 +++++++++++++++--- .../Windows/GlobalColorPickerWindow.xaml.cs | 67 ++++++++++++++++++- 2 files changed, 118 insertions(+), 14 deletions(-) diff --git a/Control/Windows/GlobalColorPickerWindow.xaml b/Control/Windows/GlobalColorPickerWindow.xaml index 7d5a69d..e179746 100644 --- a/Control/Windows/GlobalColorPickerWindow.xaml +++ b/Control/Windows/GlobalColorPickerWindow.xaml @@ -5,6 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:GeekDesk.Control.Windows" xmlns:hc="https://handyorg.github.io/handycontrol" + xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF" WindowStyle="None" AllowsTransparency="True" Background="Transparent" @@ -14,15 +15,59 @@ Background="White" Height="385" Width="228"> - - - + + + + + - - - + + - + + diff --git a/Control/Windows/GlobalColorPickerWindow.xaml.cs b/Control/Windows/GlobalColorPickerWindow.xaml.cs index 80f69ac..65a3a7a 100644 --- a/Control/Windows/GlobalColorPickerWindow.xaml.cs +++ b/Control/Windows/GlobalColorPickerWindow.xaml.cs @@ -1,5 +1,8 @@ using GeekDesk.Interface; +using GeekDesk.Util; using System; +using System.Collections.ObjectModel; +using System.ComponentModel; using System.Threading; using System.Windows; using System.Windows.Controls; @@ -14,10 +17,33 @@ namespace GeekDesk.Control.Windows public partial class GlobalColorPickerWindow : IWindowCommon { PixelColorPickerWindow colorPickerWindow = null; + + class PrivateDataContext : INotifyPropertyChanged + { + private bool copyAnimation = false; + + public bool CopyAnimation + { + set + { + copyAnimation = value; + OnPropertyChanged("CopyAnimation"); + + } + get { return copyAnimation; } + } + + public event PropertyChangedEventHandler PropertyChanged; + private void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } public GlobalColorPickerWindow() { this.Topmost = true; InitializeComponent(); + this.DataContext = new PrivateDataContext(); } public void OnKeyDown(object sender, KeyEventArgs e) @@ -35,14 +61,26 @@ namespace GeekDesk.Control.Windows /// /// /// - private void MyColorPicker_Canceled(object sender, EventArgs e) + private void MyColorPicker_Canceled(object sender, RoutedEventArgs e) { MyColorPickerClose(); } - private void MyColorPicker_Confirmed(object sender, HandyControl.Data.FunctionEventArgs e) + private void MyColorPicker_Confirmed(object sender, RoutedEventArgs e) { + CopySuccess.Visibility = Visibility.Visible; + PrivateDataContext pdc = this.DataContext as PrivateDataContext; + pdc.CopyAnimation = true; + new Thread(() => + { + Thread.Sleep(400); + this.Dispatcher.Invoke(() => + { + pdc.CopyAnimation = false; + CopySuccess.Visibility = Visibility.Collapsed; + }); + }).Start(); Color c = MyColorPicker.SelectedBrush.Color; - Clipboard.SetData(DataFormats.Text, string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", c.A, c.R, c.G, c.B)); + Clipboard.SetData(DataFormats.Text, string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B)); } /// @@ -148,5 +186,28 @@ namespace GeekDesk.Control.Windows { this.Close(); } + + private ICommand _hideCommand; + public ICommand HideCommand + { + get + { + if (_hideCommand == null) + { + _hideCommand = new RelayCommand( + p => + { + return true; + }, + p => + { + //CopySuccess.Visibility = Visibility.Collapsed; + }); + } + return _hideCommand; + } + } + + } } From 85ad6a6bc47b9e54f24f449a50538a31f6f0bd41 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 14 Apr 2023 18:02:18 +0800 Subject: [PATCH 24/44] =?UTF-8?q?=E2=9C=85=20=E4=BC=98=E5=8C=96everything?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.xaml.cs | 1 - Plugins/EveryThing/EveryThingUtil.cs | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index e811082..d349664 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -150,7 +150,6 @@ namespace GeekDesk { SearchResControl control = obj as SearchResControl; control.VerticalUFG.Visibility = Visibility.Collapsed; - control.SearchListBox.Items.Clear(); } } diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index bfea1b8..b729f91 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -93,7 +93,6 @@ namespace GeekDesk.Plugins.EveryThing string pluginsPath = Constants.PLUGINS_PATH; bool Is64Bit = Environment.Is64BitOperatingSystem; string everyThingPath = pluginsPath + "/EveryThing/" + (Is64Bit ? 64 : 32) + "/EveryThing.exe"; - string installUtilPath = "C:\\Windows\\Microsoft.NET\\Framework" + (Is64Bit ? "64" : "") + "\\v4.0.30319\\InstallUtil.exe"; Process p = new Process(); p.StartInfo.FileName = everyThingPath; @@ -101,12 +100,14 @@ namespace GeekDesk.Plugins.EveryThing switch(type) { default: + p.StartInfo.Verb = "runas"; arg = "-start-service"; break; case ServiceType.STOP: arg = "-stop-service"; break; case ServiceType.INSTALL: + p.StartInfo.Verb = "runas"; arg = "-install-service"; break; case ServiceType.UNINSTALL: @@ -150,12 +151,16 @@ namespace GeekDesk.Plugins.EveryThing catch (Exception e) { } try { - if (uninstall) + if (GetService("Everything") != null) { - EveryThingService(ServiceType.UNINSTALL); - } else - { - EveryThingService(ServiceType.STOP); + if (uninstall) + { + EveryThingService(ServiceType.UNINSTALL); + } + else + { + EveryThingService(ServiceType.STOP); + } } } catch (Exception e) { } From dd4163519979a73d3cac452150d31cdf71f2f543 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 14 Apr 2023 21:30:15 +0800 Subject: [PATCH 25/44] =?UTF-8?q?=F0=9F=90=94=20=E4=BC=98=E5=8C=96everythi?= =?UTF-8?q?ng=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/RunTimeStatus.cs | 2 +- Control/Other/SearchResControl.xaml | 8 +- Control/Other/SearchResControl.xaml.cs | 50 ++++++++++++ MainWindow.xaml.cs | 103 ++----------------------- Plugins/EveryThing/EveryThing32.cs | 2 +- Plugins/EveryThing/EveryThing64.cs | 2 +- Plugins/EveryThing/EveryThingUtil.cs | 16 ++-- 7 files changed, 71 insertions(+), 112 deletions(-) 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); } } From 6072832654f8a0d5d2b47fbe330fb14f6d75b590 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Mon, 17 Apr 2023 13:26:58 +0800 Subject: [PATCH 26/44] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/WidthTypeEnum.cs | 1 + Control/UserControls/PannelCard/RightCardControl.xaml | 6 ++---- Converts/GetWidthByWWConvert.cs | 8 ++++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Constant/WidthTypeEnum.cs b/Constant/WidthTypeEnum.cs index b50130c..b9e0bfa 100644 --- a/Constant/WidthTypeEnum.cs +++ b/Constant/WidthTypeEnum.cs @@ -14,5 +14,6 @@ namespace GeekDesk.Constant RIGHT_CARD_HALF_TEXT = 3, //右侧托盘宽度的一半 再减去左侧图像宽度 RIGHT_CARD_20 = 4, //右侧托盘宽度 - 20 RIGHT_CARD_40 = 5, //右侧托盘宽度 - 40 + RIGHT_CARD_70 = 6, //右侧托盘宽度 - 70 } } diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml index b6e1da2..724e696 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml +++ b/Control/UserControls/PannelCard/RightCardControl.xaml @@ -186,9 +186,7 @@ > @@ -212,7 +210,7 @@ VirtualizingPanel.ScrollUnit="Pixel" Width="{Binding AppConfig.WindowWidth, Mode=OneWay, Converter={StaticResource GetWidthByWWConvert}, - ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_40}}" + ConverterParameter={x:Static cst:WidthTypeEnum.RIGHT_CARD_70}}" /> diff --git a/Converts/GetWidthByWWConvert.cs b/Converts/GetWidthByWWConvert.cs index bef3e32..7f2633d 100644 --- a/Converts/GetWidthByWWConvert.cs +++ b/Converts/GetWidthByWWConvert.cs @@ -34,6 +34,14 @@ namespace GeekDesk.Converts { return (config.WindowWidth - config.MenuCardWidth) - 20; } + else if (WidthTypeEnum.RIGHT_CARD_40 == type) + { + return (config.WindowWidth - config.MenuCardWidth) - 40; + } + else if (WidthTypeEnum.RIGHT_CARD_70 == type) + { + return (config.WindowWidth - config.MenuCardWidth) - 70; + } return config.WindowWidth; } From 48fffa6da75b810c384902855c2051db1790be90 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Mon, 17 Apr 2023 14:12:31 +0800 Subject: [PATCH 27/44] =?UTF-8?q?=F0=9F=A5=95=20=E4=BC=98=E5=8C=96everythi?= =?UTF-8?q?ng=20=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/SearchResControl.xaml.cs | 7 +++---- MainWindow.xaml | 10 +++++++++- MainWindow.xaml.cs | 14 +++++++++++--- Plugins/EveryThing/EveryThingUtil.cs | 23 ++++++++++++----------- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Control/Other/SearchResControl.xaml.cs b/Control/Other/SearchResControl.xaml.cs index 14c32a4..ecdd3f6 100644 --- a/Control/Other/SearchResControl.xaml.cs +++ b/Control/Other/SearchResControl.xaml.cs @@ -254,8 +254,7 @@ namespace GeekDesk.Control.Other { EveryThingRuning = true; MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Visible; - string[] split = MainWindow.mainWindow.SearchResText.Text.Split(' '); - long count = Convert.ToInt64(split[0]); + int everyThingCount = Convert.ToInt32(MainWindow.mainWindow.EverythingSearchCount.Text); ObservableCollection resList = this.DataContext as ObservableCollection; @@ -264,8 +263,8 @@ namespace GeekDesk.Control.Other ObservableCollection searchRes = EveryThingUtil.NextPage(); this.Dispatcher.Invoke(() => { - count += searchRes.Count; - MainWindow.mainWindow.SearchResText.Text = count + " of " + split[split.Length - 1]; + everyThingCount += searchRes.Count; + MainWindow.mainWindow.EverythingSearchCount.Text = Convert.ToString(everyThingCount); foreach (IconInfo info in searchRes) { resList.Add(info); diff --git a/MainWindow.xaml b/MainWindow.xaml index 3b24513..00bc367 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -160,7 +160,15 @@ - + + + + + + + + + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 1a1033a..aa832d8 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -176,7 +176,11 @@ namespace GeekDesk this.Dispatcher.Invoke(() => { string inputText = SearchBox.Text.ToLower().Trim(); - + if (string.IsNullOrEmpty(inputText)) + { + RightCard.Loading_RightCard.Visibility = Visibility.Collapsed; + return; + } new Thread(() => { ObservableCollection resList = new ObservableCollection(); @@ -190,6 +194,7 @@ namespace GeekDesk } } + int geekDeskCount = 0; //GeekDesk数据搜索 ObservableCollection menuList = appData.MenuList; foreach (MenuInfo menu in menuList) @@ -201,6 +206,7 @@ namespace GeekDesk string pyName = Pinyin.GetInitials(icon.Name).ToLower(); if (icon.Name.Contains(inputText) || pyName.Contains(inputText)) { + geekDeskCount++; resList.Add(icon); } } @@ -210,7 +216,10 @@ namespace GeekDesk { if (appData.AppConfig.EnableEveryThing == true) { - SearchResText.Text = resList.Count + " of " + Convert.ToInt32(EveryThingUtil.Everything_GetNumResults()); + int everythingTotal = Convert.ToInt32(EveryThingUtil.Everything_GetNumResults()); + GeekDeskSearchTotal.Text = Convert.ToString(geekDeskCount); + EverythingSearchCount.Text = Convert.ToString(resList.Count - geekDeskCount); + EverythingSearchTotal.Text = Convert.ToString(everythingTotal + geekDeskCount); SearchResContainer.Visibility = Visibility.Visible; } SearchResControl control = new SearchResControl(resList); @@ -246,7 +255,6 @@ namespace GeekDesk SearchBox.Clear(); SearchBox.TextChanged += SearchBox_TextChanged; SearchBox.Width = 0; - SearchResText.Text = "0 of 0"; SearchResContainer.Visibility = Visibility.Collapsed; RightCard.VerticalCard.Content = null; RightCard.VisibilitySearchCard(Visibility.Collapsed); diff --git a/Plugins/EveryThing/EveryThingUtil.cs b/Plugins/EveryThing/EveryThingUtil.cs index d64995e..e524148 100644 --- a/Plugins/EveryThing/EveryThingUtil.cs +++ b/Plugins/EveryThing/EveryThingUtil.cs @@ -185,9 +185,10 @@ namespace GeekDesk.Plugins.EveryThing | EveryThingConst.EVERYTHING_REQUEST_DATE_MODIFIED | EveryThingConst.EVERYTHING_REQUEST_SIZE); EveryThingUtil.Everything_SetSort( - EveryThingConst.EVERYTHING_SORT_DATE_MODIFIED_DESCENDING - | EveryThingConst.EVERYTHING_SORT_TYPE_NAME_DESCENDING - | EveryThingConst.EVERYTHING_SORT_RUN_COUNT_DESCENDING); + EveryThingConst.EVERYTHING_SORT_TYPE_NAME_DESCENDING + | EveryThingConst.EVERYTHING_SORT_RUN_COUNT_DESCENDING + | EveryThingConst.EVERYTHING_SORT_DATE_MODIFIED_DESCENDING + ); EveryThingUtil.Everything_Query(true); return NextPage(); } @@ -220,15 +221,15 @@ namespace GeekDesk.Plugins.EveryThing ext = System.IO.Path.GetExtension(filePath).ToLower(); } - if (".lnk".Equals(ext)) - { + //if (".lnk".Equals(ext)) + //{ - string targetPath = FileUtil.GetTargetPathByLnk(filePath); - if (targetPath != null) - { - filePath = targetPath; - } - } + // string targetPath = FileUtil.GetTargetPathByLnk(filePath); + // if (targetPath != null) + // { + // filePath = targetPath; + // } + //} string name = System.IO.Path.GetFileNameWithoutExtension(tempPath); if (string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(tempPath)) From 4565dc5bd6d954c643fa614bab54348710206bae Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Mon, 17 Apr 2023 15:07:28 +0800 Subject: [PATCH 28/44] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E6=8F=90=E7=A4=BA=E6=9C=AA=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/PasswordDialog.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Control/Other/PasswordDialog.xaml.cs b/Control/Other/PasswordDialog.xaml.cs index c6139ac..143b7e1 100644 --- a/Control/Other/PasswordDialog.xaml.cs +++ b/Control/Other/PasswordDialog.xaml.cs @@ -105,6 +105,7 @@ namespace GeekDesk.Control.Other if (!string.IsNullOrEmpty(appData.AppConfig.PasswordHint)) { //显示提示信息 + HintMsg.Text = "提示: " + appData.AppConfig.PasswordHint; HintMsg.Visibility = Visibility.Visible; } } From 08b4596f31c42786ab2ee91fc43d9d65f8ffc2a5 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Tue, 18 Apr 2023 18:13:25 +0800 Subject: [PATCH 29/44] =?UTF-8?q?:tada:=20=E6=B7=BB=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E6=89=8B=E5=BC=95=E5=AF=BC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.xaml | 263 +++++++++++++++++++++++++++--------------- MainWindow.xaml.cs | 156 +++++++++++++++++++++---- Util/BGSettingUtil.cs | 2 +- 3 files changed, 305 insertions(+), 116 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index 00bc367..2157a23 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -54,10 +54,81 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 2931fd5..904f657 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -17,6 +17,7 @@ using ShowSeconds; using System; using System.Collections.ObjectModel; using System.Diagnostics; +using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -48,8 +49,13 @@ namespace GeekDesk public static int toDoHotKeyId = -1; public static int colorPickerHotKeyId = -1; public static MainWindow mainWindow; + + private static bool dataFileExist = true; public MainWindow() { + //判断数据文件是否存在 如果不存在那么是第一次打开程序 + dataFileExist = File.Exists(Constants.DATA_FILE_PATH); + //加载数据 LoadData(); InitializeComponent(); @@ -359,7 +365,10 @@ namespace GeekDesk MessageUtil.ChangeWindowMessageFilter(MessageUtil.WM_COPYDATA, 1); - Guide(); + if (!dataFileExist) + { + Guide(); + } } @@ -1016,78 +1025,48 @@ namespace GeekDesk - class GuideInfo - { - private string title1; - private string title2; - private string guideText; - - public string Title1 { get; set; } - public string Title2 { get; set; } - public string GuideText { get; set; } - } - enum GuidePopOffect - { - TOP, - INNER_TOP, - LEFT, - INNER_LEFT, - CENTER, - RIGHT, - INNER_RIGHT, - BOTTOM, - INNER_BOTTOM - } - - private ObservableCollection list = new ObservableCollection(); - + #region 新手引导 private void Guide() { - - GuideInfo guideInfo = new GuideInfo + if (CheckShouldShowApp()) { - Title1 = "提示1", - Title2 = "快捷方式创建", - GuideText = "将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目" - }; - list.Add(guideInfo); - - guideInfo = new GuideInfo - { - Title1 = "提示2", - Title2 = "快捷方式创建", - GuideText = "将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目" - }; - list.Add(guideInfo); - - guideInfo = new GuideInfo - { - Title1 = "提示3", - Title2 = "快捷方式创建", - GuideText = "将文件拖动到这里自动创建快捷方式, 或者鼠标右键单击添加系统项目" - }; - list.Add(guideInfo); - + ShowApp(); + } GrayBorder.Visibility = Visibility.Visible; GuideSwitch(0); GuideCard.Visibility = Visibility.Visible; } - private void GuideSwitch(int num) + private void GuideSwitch(int index) { - switch (num) + GuideNum.Text = Convert.ToString(index + 1); + GuideTitle1.Text = GuideInfoList.mainWindowGuideList[index].Title1; + GuideTitle2.Text = GuideInfoList.mainWindowGuideList[index].Title2; + GuideText.Text = GuideInfoList.mainWindowGuideList[index].GuideText; + + if (index == 0) + { + PreviewGuideBtn.Visibility = Visibility.Collapsed; + NextGuideBtn.Content = "下一步"; + } else if (index > 0 && index < GuideInfoList.mainWindowGuideList.Count - 1) + { + PreviewGuideBtn.Visibility = Visibility.Visible; + NextGuideBtn.Content = "下一步"; + } else + { + NextGuideBtn.Content = "完成"; + } + + switch (index) { default: //0 //右侧列表区域 - PreviewGuideBtn.Visibility = Visibility.Collapsed; - NextGuideBtn.Content = "下一步"; + Point point = RightCard.TransformToAncestor(this).Transform(new Point(0, 0)); //内部中上 GrayBoderClip(point.X, point.Y, RightCard.ActualWidth, RightCard.ActualHeight, new Thickness(point.X + RightCard.ActualWidth / 2 - GuideCard.ActualWidth / 2, point.Y, 0, 0)); break; case 1: //左侧菜单 - PreviewGuideBtn.Visibility = Visibility.Visible; - NextGuideBtn.Content = "下一步"; Point leftCardPoint = LeftCard.TransformToAncestor(this).Transform(new Point(0, 0)); GrayBoderClip(leftCardPoint.X , leftCardPoint.Y , LeftCard.ActualWidth, LeftCard.ActualHeight, // 外部中下侧 @@ -1095,11 +1074,17 @@ namespace GeekDesk leftCardPoint.Y + LeftCard.ActualHeight / 2 - GuideCard.ActualHeight / 2, 0, 0)); break; case 2: //头部拖拽栏 - NextGuideBtn.Content = "完成"; GrayBoderClip(0, 0, this.Width, 50, // 外部中下侧 new Thickness(this.Width / 2 - GuideCard.ActualWidth / 2, 50, 0, 0)); break; + case 3: + Point mainBtnPoint = MainBtnPanel.TransformToAncestor(this).Transform(new Point(0, 0)); + GrayBoderClip(mainBtnPoint.X, mainBtnPoint.Y, MainBtnPanel.ActualWidth, MainBtnPanel.ActualHeight, + // 外部左下侧 + new Thickness(mainBtnPoint.X - GuideCard.Width, + mainBtnPoint.Y, 0, 0)); + break; } } @@ -1122,11 +1107,8 @@ namespace GeekDesk private void PreviewGuideBtn_Click(object sender, RoutedEventArgs e) { - int index = Convert.ToInt32(GuideTitle1.Text.ToString().Substring(2)) - 1; + int index = Convert.ToInt32(GuideNum.Text.ToString()) - 1; int previewIndex = index - 1; - GuideTitle1.Text = list[previewIndex].Title1; - GuideTitle2.Text = list[previewIndex].Title2; - GuideText.Text = list[previewIndex].GuideText; GuideSwitch(previewIndex); } @@ -1137,12 +1119,17 @@ namespace GeekDesk GuideCard.Visibility = Visibility.Collapsed; return; } - int index = Convert.ToInt32(GuideTitle1.Text.ToString().Substring(2)) - 1; + int index = Convert.ToInt32(GuideNum.Text.ToString()) - 1; int nextIndex = index + 1; - GuideTitle1.Text = list[nextIndex].Title1; - GuideTitle2.Text = list[nextIndex].Title2; - GuideText.Text = list[nextIndex].GuideText; GuideSwitch(nextIndex); } + + + #endregion + + private void Guide_Click(object sender, RoutedEventArgs e) + { + Guide(); + } } } diff --git a/ViewModel/Temp/GuideInfoList.cs b/ViewModel/Temp/GuideInfoList.cs new file mode 100644 index 0000000..ad36f89 --- /dev/null +++ b/ViewModel/Temp/GuideInfoList.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GeekDesk.Util +{ + public class GuideInfoList + { + + public static ObservableCollection mainWindowGuideList = new ObservableCollection(); + + static GuideInfoList() + { + GuideInfo guideInfo = new GuideInfo + { + Title1 = "引导提示", + Title2 = "图标列表区", + GuideText = "右侧高亮区域是图标列表区, 将文件拖动到图标列表区将自动创建快捷方式, 或者鼠标右键单击添加系统项目" + }; + mainWindowGuideList.Add(guideInfo); + + guideInfo = new GuideInfo + { + Title1 = "引导提示", + Title2 = "菜单栏", + GuideText = "左侧高亮区域是菜单栏, 右键单击左侧区域可以创建菜单, 右键单击菜单可以对菜单进行操作" + }; + mainWindowGuideList.Add(guideInfo); + + guideInfo = new GuideInfo + { + Title1 = "引导提示", + Title2 = "拖动区域", + GuideText = "左键按住上部高亮区域可以拖动程序窗体" + }; + mainWindowGuideList.Add(guideInfo); + + guideInfo = new GuideInfo + { + Title1 = "引导提示", + Title2 = "设置和关闭", + GuideText = "高亮区域的两个按钮分别是设置和关闭按钮, 你可以点击设置按钮重新打开引导提示, 设置窗口中可自定义开启或关闭众多功能, 赶紧探索使用吧" + }; + + mainWindowGuideList.Add(guideInfo); + } + + + public class GuideInfo + { + private string title1; + private string title2; + private string guideText; + + public string Title1 { get; set; } + public string Title2 { get; set; } + public string GuideText { get; set; } + } + + public enum GuidePopOffect + { + TOP, + INNER_TOP, + LEFT, + INNER_LEFT, + CENTER, + RIGHT, + INNER_RIGHT, + BOTTOM, + INNER_BOTTOM + } + + + + } +} From 943e8bcefbb6dcffa8ab0651f1be432629013a50 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Wed, 19 Apr 2023 15:44:50 +0800 Subject: [PATCH 31/44] =?UTF-8?q?:tada:=20=E6=B7=BB=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E6=89=8B=E5=BC=95=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.xaml.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 904f657..8678274 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -1028,13 +1028,18 @@ namespace GeekDesk #region 新手引导 private void Guide() { - if (CheckShouldShowApp()) + try { - ShowApp(); + //防止影响主程序进程 + if (CheckShouldShowApp()) + { + ShowApp(); + } + GrayBorder.Visibility = Visibility.Visible; + GuideSwitch(0); + GuideCard.Visibility = Visibility.Visible; } - GrayBorder.Visibility = Visibility.Visible; - GuideSwitch(0); - GuideCard.Visibility = Visibility.Visible; + catch (Exception) { } } private void GuideSwitch(int index) From 9de5a19f7f31d3f946861825fcf96ed645fc6c48 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Wed, 19 Apr 2023 15:50:46 +0800 Subject: [PATCH 32/44] =?UTF-8?q?:tada:=20=E6=B7=BB=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E6=89=8B=E5=BC=95=E5=AF=BC=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.xaml.cs | 11 +++++++---- Update.json | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 8678274..0bb7945 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -43,7 +43,7 @@ namespace GeekDesk public partial class MainWindow : Window, IWindowCommon { - public static AppData appData = CommonCode.GetAppDataByFile(); + public static AppData appData; public static ToDoInfoWindow toDoInfoWindow; public static int hotKeyId = -1; public static int toDoHotKeyId = -1; @@ -53,9 +53,7 @@ namespace GeekDesk private static bool dataFileExist = true; public MainWindow() { - //判断数据文件是否存在 如果不存在那么是第一次打开程序 - dataFileExist = File.Exists(Constants.DATA_FILE_PATH); - + //加载数据 LoadData(); InitializeComponent(); @@ -276,6 +274,11 @@ namespace GeekDesk /// private void LoadData() { + //判断数据文件是否存在 如果不存在那么是第一次打开程序 + dataFileExist = File.Exists(Constants.DATA_FILE_PATH); + + appData = CommonCode.GetAppDataByFile(); + this.DataContext = appData; if (appData.MenuList.Count == 0) { diff --git a/Update.json b/Update.json index 1ed291c..a13a502 100644 --- a/Update.json +++ b/Update.json @@ -1,9 +1,9 @@ { "title": "GeekDesk版本更新", - "subTitle": "V2.5.13", + "subTitle": "V2.5.14", "msgTitle": "本次更新内容如下", - "msg": "['求Star,求Star', '集成Win11显秒插件', '崩溃问题修复', '现在在右侧栏(快捷图标区域)也可以鼠标滚轮切换菜单了', '缩放屏幕截图问题修复(感谢@1062406901提的PR)', '更改一下Logo', '其它已知问题修复']", + "msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家都前程似锦吧', '另外GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @huangcan', '多显示器拾色器bug修复 By @huangcan', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '其它bug修复及功能优化']", "githubUrl": "https://github.com/BookerLiu/GeekDesk/releases", "giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases", - "version": "2.5.13" + "version": "2.5.14" } \ No newline at end of file From 08424b0db0499a48ea1ee29c8af458c9fa4c7d8a Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Wed, 19 Apr 2023 16:51:56 +0800 Subject: [PATCH 33/44] =?UTF-8?q?:bug:=20=E9=98=B2=E6=AD=A2=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=85=B3=E9=97=AD=E6=90=9C=E7=B4=A2=E6=A1=86=E5=90=8E?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=88=97=E8=A1=A8=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/RunTimeStatus.cs | 10 +++++++++- .../UserControls/PannelCard/RightCardControl.xaml.cs | 2 ++ MainWindow.xaml.cs | 6 ++++++ Update.json | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Constant/RunTimeStatus.cs b/Constant/RunTimeStatus.cs index 91792bd..e4b2914 100644 --- a/Constant/RunTimeStatus.cs +++ b/Constant/RunTimeStatus.cs @@ -1,4 +1,6 @@ -namespace GeekDesk.Constant +using System; + +namespace GeekDesk.Constant { internal class RunTimeStatus { @@ -8,6 +10,11 @@ /// public static volatile bool SEARCH_BOX_SHOW = false; + /// + /// 查询框是否已经关闭了300毫秒 防止点击右侧区域关闭查询框时误打开列表 + /// + public static volatile bool SEARCH_BOX_HIDED_300 = true; + /// /// 贴边隐藏后 以非鼠标经过方式触发显示 /// @@ -78,5 +85,6 @@ /// 控制主界面热键按下规定时间内只执行一次show hide /// public static volatile int MAIN_HOT_KEY_TIME = 300; + } } diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml.cs b/Control/UserControls/PannelCard/RightCardControl.xaml.cs index 81db405..9aa39e2 100644 --- a/Control/UserControls/PannelCard/RightCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/RightCardControl.xaml.cs @@ -126,6 +126,8 @@ namespace GeekDesk.Control.UserControls.PannelCard /// private void IconClick(object sender, MouseButtonEventArgs e) { + if (!RunTimeStatus.SEARCH_BOX_HIDED_300) return; + if (appData.AppConfig.DoubleOpen && e.ClickCount >= 2) { IconInfo icon = (IconInfo)((Panel)sender).Tag; diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 0bb7945..d0849fc 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -246,6 +246,12 @@ namespace GeekDesk public void HidedSearchBox() { RunTimeStatus.EVERYTHING_NEW_SEARCH = true; + RunTimeStatus.SEARCH_BOX_HIDED_300 = false; + new Thread(() => + { + Thread.Sleep(300); + RunTimeStatus.SEARCH_BOX_HIDED_300 = true; + }).Start(); new Thread(() => { Thread.Sleep(1000); diff --git a/Update.json b/Update.json index a13a502..f020ddb 100644 --- a/Update.json +++ b/Update.json @@ -2,7 +2,7 @@ "title": "GeekDesk版本更新", "subTitle": "V2.5.14", "msgTitle": "本次更新内容如下", - "msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家都前程似锦吧', '另外GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @huangcan', '多显示器拾色器bug修复 By @huangcan', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '其它bug修复及功能优化']", + "msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家都前程似锦吧', '另外GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @1062406901', '多显示器拾色器bug修复 By @1062406901', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '优化部分UI', '其它bug修复及功能优化']", "githubUrl": "https://github.com/BookerLiu/GeekDesk/releases", "giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases", "version": "2.5.14" From 9485b801b6c67394544855d8e028e85021186ece Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Wed, 19 Apr 2023 22:19:44 +0800 Subject: [PATCH 34/44] =?UTF-8?q?=F0=9F=92=A9=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BB=9F=E8=AE=A1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Constant/Constants.cs | 2 ++ MyThread/UpdateThread.cs | 10 ++++++++++ Update.json | 1 + Util/CommonCode.cs | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+) diff --git a/Constant/Constants.cs b/Constant/Constants.cs index 37c8ddb..95e22be 100644 --- a/Constant/Constants.cs +++ b/Constant/Constants.cs @@ -26,6 +26,8 @@ namespace GeekDesk.Constant public static string PW_FILE_BAK_PATH = APP_DIR + "bak\\pw.txt"; //密码文件路径 + public static string UUID_FILE_BAK_PATH = APP_DIR + "bak\\uuid.txt"; //密码文件路径 + public static string LOG_FILE_PATH = APP_DIR + "logs\\log.log"; //日志文件 public static string ERROR_FILE_PATH = APP_DIR + "logs\\error.log"; // 错误日志 diff --git a/MyThread/UpdateThread.cs b/MyThread/UpdateThread.cs index 0fc5a8f..01bc80e 100644 --- a/MyThread/UpdateThread.cs +++ b/MyThread/UpdateThread.cs @@ -50,6 +50,16 @@ namespace GeekDesk.MyThread if (!StringUtil.IsEmpty(updateInfo)) { JObject jo = JObject.Parse(updateInfo); + + + string statisticUrl = jo["statisticUrl"].ToString(); + if (!string.IsNullOrEmpty(statisticUrl)) + { + //用户统计 只通过uuid统计用户数量 不收集任何信息 + statisticUrl += "?uuid=" + CommonCode.GetUniqueUUID(); + HttpUtil.Get(statisticUrl); + } + string onlineVersion = jo["version"].ToString(); if (onlineVersion.CompareTo(nowVersion) > 0) { diff --git a/Update.json b/Update.json index f020ddb..e0af958 100644 --- a/Update.json +++ b/Update.json @@ -5,5 +5,6 @@ "msg": "['好久不见, 别来无恙, 辞职回老家了, 突然换了新环境有点不适应, 目前还处于工作中的迷茫期, 祝我们大家都前程似锦吧', '另外GeekDesk准备冲击一下Gitee GVP, 希望大家能给我点一下码云(Gitee)和GitHub的star❤❤❤', '之后我会抽时间编写一下开发者文档, 方便大家更清楚的了解项目结构, 从而有更多的人参与进来开发(一直没有编写是因为太懒了), 不多说了, 看下这次更新内容吧', '集成Everything搜索,设置-->其它-->勾选Everything插件开启', '增加了关联文件夹功能, 右键点击左侧栏-->新建关联菜单', '增加强制置顶开关,设置-->显示设置-->勾选/取消 置于顶层', '右侧栏图标列表增加了自适应列宽, 不会出现图标显示一半的情况了', '简单添加了新手引导提示', '加密菜单bug修复 By @1062406901', '多显示器拾色器bug修复 By @1062406901', '拖动图标到菜单的异常修复 By @Hsxxxxxx', '优化部分UI', '其它bug修复及功能优化']", "githubUrl": "https://github.com/BookerLiu/GeekDesk/releases", "giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases", + "statisticUrl": "", "version": "2.5.14" } \ No newline at end of file diff --git a/Util/CommonCode.cs b/Util/CommonCode.cs index 0b3ad8b..4602ac3 100644 --- a/Util/CommonCode.cs +++ b/Util/CommonCode.cs @@ -130,6 +130,41 @@ namespace GeekDesk.Util } } + private static string GeneraterUUID() + { + try + { + if (!File.Exists(Constants.UUID_FILE_BAK_PATH) || string.IsNullOrEmpty(GetUniqueUUID())) + { + using (StreamWriter sw = new StreamWriter(Constants.UUID_FILE_BAK_PATH)) + { + string uuid = Guid.NewGuid().ToString() + "-" + Constants.MY_UUID; + sw.Write(uuid); + return uuid; + } + } + } catch (Exception) { } + return "ERROR_UUID_GeneraterUUID_" + Constants.MY_UUID; + } + + public static string GetUniqueUUID() + { + try + { + if (File.Exists(Constants.UUID_FILE_BAK_PATH)) + { + using (StreamReader reader = new StreamReader(Constants.UUID_FILE_BAK_PATH)) + { + return reader.ReadToEnd().Trim(); + } + } else + { + return GeneraterUUID(); + } + } catch(Exception) { } + return "ERROR_UUID_GetUniqueUUID_" + Constants.MY_UUID; + } + public static void BakAppData() { From ea39576709f8e7750e09f42d7bf140e81ea60c16 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 21 Apr 2023 14:16:58 +0800 Subject: [PATCH 35/44] =?UTF-8?q?:poop:=20=E9=98=B2=E6=AD=A2=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=BC=B9=E5=87=BA=E6=9B=B4=E6=96=B0=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyThread/UpdateThread.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/MyThread/UpdateThread.cs b/MyThread/UpdateThread.cs index 01bc80e..b6b08d1 100644 --- a/MyThread/UpdateThread.cs +++ b/MyThread/UpdateThread.cs @@ -51,14 +51,18 @@ namespace GeekDesk.MyThread { JObject jo = JObject.Parse(updateInfo); - - string statisticUrl = jo["statisticUrl"].ToString(); - if (!string.IsNullOrEmpty(statisticUrl)) + try { - //用户统计 只通过uuid统计用户数量 不收集任何信息 - statisticUrl += "?uuid=" + CommonCode.GetUniqueUUID(); - HttpUtil.Get(statisticUrl); - } + string statisticUrl = jo["statisticUrl"].ToString(); + if (!string.IsNullOrEmpty(statisticUrl)) + { + //用户统计 只通过uuid统计用户数量 不收集任何信息 + statisticUrl += "?uuid=" + CommonCode.GetUniqueUUID(); + HttpUtil.Get(statisticUrl); + } + } catch (Exception){} + + string onlineVersion = jo["version"].ToString(); if (onlineVersion.CompareTo(nowVersion) > 0) From 6fd1e65db7212ef7aab84c46e42327f2874bf957 Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 21 Apr 2023 17:35:18 +0800 Subject: [PATCH 36/44] =?UTF-8?q?:sparkles:=20=E6=9B=B4=E6=94=B9=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/MyColorPickerDialog.xaml.cs | 8 +++++--- MainWindow.xaml | 9 ++++++++- ViewModel/Temp/GradientBGParamList.cs | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Control/Other/MyColorPickerDialog.xaml.cs b/Control/Other/MyColorPickerDialog.xaml.cs index f1075b2..9fb4839 100644 --- a/Control/Other/MyColorPickerDialog.xaml.cs +++ b/Control/Other/MyColorPickerDialog.xaml.cs @@ -1,4 +1,5 @@ using GeekDesk.Control.Windows; +using GeekDesk.Util; using GeekDesk.ViewModel; using System; using System.Reflection; @@ -64,14 +65,15 @@ namespace GeekDesk.Control.Other private void MyColorPicker_SelectedColorChanged(object sender, HandyControl.Data.FunctionEventArgs e) { SolidColorBrush scb = MyColorPicker.SelectedBrush; + Color c = scb.Color; switch (colorType) { case ColorType.COLOR_1: - appConfig.GradientBGParam.Color1 = scb.ToString(); break; + appConfig.GradientBGParam.Color1 = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break; case ColorType.COLOR_2: - appConfig.GradientBGParam.Color2 = scb.ToString(); break; + appConfig.GradientBGParam.Color2 = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break; default: - appConfig.TextColor = scb.ToString(); break; + appConfig.TextColor = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break; } } diff --git a/MainWindow.xaml b/MainWindow.xaml index 27fd6f9..36a6b00 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -181,7 +181,14 @@ - + diff --git a/ViewModel/Temp/GradientBGParamList.cs b/ViewModel/Temp/GradientBGParamList.cs index 00d81fb..6a6fa7d 100644 --- a/ViewModel/Temp/GradientBGParamList.cs +++ b/ViewModel/Temp/GradientBGParamList.cs @@ -13,7 +13,7 @@ namespace GeekDesk.ViewModel.Temp //gradientBGParams = (ObservableCollection)ConfigurationManager.GetSection("SystemBGs") gradientBGParams = new ObservableCollection { - new GradientBGParam("魅惑妖术", "#FFDDE1", "#EE9CA7"), + new GradientBGParam("魅惑妖术", "#EE9CA7", "#FFDDE1"), new GradientBGParam ("森林之友", "#EBF7E3", "#A8E4C0"), new GradientBGParam("完美谢幕", "#D76D77", "#FFAF7B") }; From f152aaf1f4f4c6aa58050ea6133687f52e0641db Mon Sep 17 00:00:00 2001 From: BookerLiu Date: Fri, 21 Apr 2023 18:05:06 +0800 Subject: [PATCH 37/44] =?UTF-8?q?:recycle:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81,=20=20=E6=8F=90=E5=8F=96=E5=85=AC=E5=85=B1=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/Other/BacklogNotificatin.xaml | 4 +- Control/Other/CustomIconUrlDialog.xaml | 6 +- Control/Other/GlobalMsgNotification.xaml | 2 +- Control/Other/GradientBGDialog.xaml | 2 +- Control/Other/IconInfoDialog.xaml | 15 ++-- .../UserControls/Config/MotionControl.xaml | 84 +++++-------------- Control/UserControls/Config/OtherControl.xaml | 62 +++++--------- Control/UserControls/Config/ThemeControl.xaml | 69 +++++---------- Control/UserControls/ToDo/TodoControl.xaml | 21 +++++ Control/Windows/GlobalColorPickerWindow.xaml | 14 +--- Control/Windows/IconfontWindow.xaml | 6 +- Control/Windows/ToDoWindow.xaml | 2 +- Control/Windows/ToDoWindow.xaml.cs | 13 +++ Control/Windows/UpdateWindow.xaml | 6 +- MainWindow.xaml | 8 +- MyThread/UpdateThread.cs | 13 +-- Resource/Dictionary/CommonStyle.xaml | 42 +++++++++- 17 files changed, 170 insertions(+), 199 deletions(-) diff --git a/Control/Other/BacklogNotificatin.xaml b/Control/Other/BacklogNotificatin.xaml index 5b63d8d..76c46ce 100644 --- a/Control/Other/BacklogNotificatin.xaml +++ b/Control/Other/BacklogNotificatin.xaml @@ -44,10 +44,10 @@ - @@ -51,12 +46,7 @@ VerticalAlignment="Top" Width="80" > - diff --git a/Control/Windows/IconfontWindow.xaml b/Control/Windows/IconfontWindow.xaml index bb9803f..0d9350f 100644 --- a/Control/Windows/IconfontWindow.xaml +++ b/Control/Windows/IconfontWindow.xaml @@ -75,9 +75,9 @@ -