Skip to content

Commit 532cab0

Browse files
merge changes from icsharpcode/ILSpy
1 parent 1dc8803 commit 532cab0

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

ICSharpCode.AvalonEdit/Search/SearchCommands.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ internal SearchInputHandler(TextArea textArea, SearchPanel panel)
8383
this.panel = panel;
8484
}
8585

86+
internal void RegisterGlobalCommands(CommandBindingCollection commandBindings)
87+
{
88+
commandBindings.Add(new CommandBinding(ApplicationCommands.Find, ExecuteFind));
89+
commandBindings.Add(new CommandBinding(SearchCommands.FindNext, ExecuteFindNext, CanExecuteWithOpenSearchPanel));
90+
commandBindings.Add(new CommandBinding(SearchCommands.FindPrevious, ExecuteFindPrevious, CanExecuteWithOpenSearchPanel));
91+
}
92+
8693
void RegisterCommands(ICollection<CommandBinding> commandBindings)
8794
{
8895
commandBindings.Add(new CommandBinding(ApplicationCommands.Find, ExecuteFind));

ICSharpCode.AvalonEdit/Search/SearchPanel.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ public static SearchPanel Install(TextArea textArea)
218218
textArea.DefaultInputHandler.NestedInputHandlers.Add(panel.handler);
219219
return panel;
220220
}
221+
222+
/// <summary>
223+
/// Adds the commands used by SearchPanel to the given CommandBindingCollection.
224+
/// </summary>
225+
public void RegisterCommands(CommandBindingCollection commandBindings)
226+
{
227+
handler.RegisterGlobalCommands(commandBindings);
228+
}
221229

222230
/// <summary>
223231
/// Removes the SearchPanel from the TextArea.
@@ -413,7 +421,11 @@ public void Close()
413421
renderer.CurrentResults.Clear();
414422
}
415423

416-
void CloseAndRemove()
424+
/// <summary>
425+
/// Closes the SearchPanel and removes it.
426+
/// </summary>
427+
[Obsolete("Use the Uninstall method instead!")]
428+
public void CloseAndRemove()
417429
{
418430
Close();
419431
textArea.DocumentChanged -= textArea_DocumentChanged;

0 commit comments

Comments
 (0)