@@ -33,6 +33,22 @@ namespace ICSharpCode.AvalonEdit.Search {
3333 /// Search commands for AvalonEdit.
3434 /// </summary>
3535 public static class SearchCommands {
36+ /// <summary>
37+ /// Opens the Find panel
38+ /// </summary>
39+ public static readonly RoutedCommand Find = new RoutedCommand (
40+ "Find" , typeof ( SearchPanel ) ,
41+ new InputGestureCollection { new KeyGesture ( Key . F , ModifierKeys . Control ) }
42+ ) ;
43+
44+ /// <summary>
45+ /// Opens the Replace panel
46+ /// </summary>
47+ public static readonly RoutedCommand Replace = new RoutedCommand (
48+ "Replace" , typeof ( SearchPanel ) ,
49+ new InputGestureCollection { new KeyGesture ( Key . H , ModifierKeys . Control ) }
50+ ) ;
51+
3652 /// <summary>
3753 /// Finds the next occurrence in the file.
3854 /// </summary>
@@ -97,6 +113,8 @@ internal SearchInputHandler(TextArea textArea, SearchPanel panel)
97113 internal void RegisterGlobalCommands ( CommandBindingCollection commandBindings ) {
98114 commandBindings . Add ( new CommandBinding ( ApplicationCommands . Find , ExecuteFind ) ) ;
99115 commandBindings . Add ( new CommandBinding ( ApplicationCommands . Replace , ExecuteReplace ) ) ;
116+ commandBindings . Add ( new CommandBinding ( SearchCommands . Find , ExecuteFind ) ) ;
117+ commandBindings . Add ( new CommandBinding ( SearchCommands . Replace , ExecuteReplace ) ) ;
100118 commandBindings . Add ( new CommandBinding ( SearchCommands . FindNext , ExecuteFindNext , CanExecuteWithOpenSearchPanel ) ) ;
101119 commandBindings . Add ( new CommandBinding ( SearchCommands . FindPrevious , ExecuteFindPrevious , CanExecuteWithOpenSearchPanel ) ) ;
102120 commandBindings . Add ( new CommandBinding ( SearchCommands . ReplaceNext , ExecuteReplaceNext , CanExecuteWithOpenSearchPanel ) ) ;
@@ -106,6 +124,8 @@ internal void RegisterGlobalCommands(CommandBindingCollection commandBindings) {
106124 void RegisterCommands ( ICollection < CommandBinding > commandBindings ) {
107125 commandBindings . Add ( new CommandBinding ( ApplicationCommands . Find , ExecuteFind ) ) ;
108126 commandBindings . Add ( new CommandBinding ( ApplicationCommands . Replace , ExecuteReplace ) ) ;
127+ commandBindings . Add ( new CommandBinding ( SearchCommands . Find , ExecuteFind ) ) ;
128+ commandBindings . Add ( new CommandBinding ( SearchCommands . Replace , ExecuteReplace ) ) ;
109129 commandBindings . Add ( new CommandBinding ( SearchCommands . FindNext , ExecuteFindNext , CanExecuteWithOpenSearchPanel ) ) ;
110130 commandBindings . Add ( new CommandBinding ( SearchCommands . FindPrevious , ExecuteFindPrevious , CanExecuteWithOpenSearchPanel ) ) ;
111131 commandBindings . Add ( new CommandBinding ( SearchCommands . ReplaceNext , ExecuteReplaceNext , CanExecuteWithOpenSearchPanel ) ) ;
0 commit comments