Browse Source

fixed bug in SearchPanel: could not be opened again, if it was closed before.

pull/23/head
Siegfried Pammer 14 years ago
parent
commit
213847c31b
  1. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchCommands.cs
  2. 7
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchPanel.cs

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchCommands.cs

@ -71,7 +71,7 @@ namespace ICSharpCode.AvalonEdit.Search @@ -71,7 +71,7 @@ namespace ICSharpCode.AvalonEdit.Search
void ExecuteFind(object sender, ExecutedRoutedEventArgs e)
{
if (panel == null) {
if (panel == null || panel.IsClosed) {
panel = new SearchPanel();
panel.Attach(TextArea);
}

7
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Search/SearchPanel.cs

@ -323,6 +323,11 @@ namespace ICSharpCode.AvalonEdit.Search @@ -323,6 +323,11 @@ namespace ICSharpCode.AvalonEdit.Search
}
}
/// <summary>
/// Gets whether the Panel is already closed.
/// </summary>
public bool IsClosed { get; private set; }
/// <summary>
/// Closes the SearchPanel.
/// </summary>
@ -336,6 +341,8 @@ namespace ICSharpCode.AvalonEdit.Search @@ -336,6 +341,8 @@ namespace ICSharpCode.AvalonEdit.Search
if (currentDocument != null)
currentDocument.TextChanged -= textArea_Document_TextChanged;
messageView.IsOpen = false;
textArea.Focus();
IsClosed = true;
}
}

Loading…
Cancel
Save