Browse Source

Enable AvalonEdit SearchPanel for DecompilerTextView. Closes #261.

pull/320/merge
Daniel Grunwald 14 years ago
parent
commit
43ad684022
  1. 2
      ILSpy/ISmartTextOutput.cs
  2. 3
      ILSpy/TextView/DecompilerTextView.cs
  3. 15
      ILSpy/TextView/DecompilerTextView.xaml

2
ILSpy/ISmartTextOutput.cs

@ -49,6 +49,8 @@ namespace ICSharpCode.ILSpy
Button button = new Button();
button.Cursor = Cursors.Arrow;
button.Margin = new Thickness(2);
button.Padding = new Thickness(9, 1, 9, 1);
button.MinWidth = 73;
if (icon != null) {
button.Content = new StackPanel {
Orientation = Orientation.Horizontal,

3
ILSpy/TextView/DecompilerTextView.cs

@ -33,7 +33,6 @@ using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Threading;
using System.Xml;
using ICSharpCode.AvalonEdit;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
@ -41,6 +40,7 @@ using ICSharpCode.AvalonEdit.Folding;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.AvalonEdit.Search;
using ICSharpCode.Decompiler;
using ICSharpCode.ILSpy.AvalonEdit;
using ICSharpCode.ILSpy.Bookmarks;
@ -121,6 +121,7 @@ namespace ICSharpCode.ILSpy.TextView
// Bookmarks context menu
IconMarginActionsProvider.Add(iconMargin);
textEditor.TextArea.DefaultInputHandler.NestedInputHandlers.Add(new SearchInputHandler(textEditor.TextArea));
this.Loaded += new RoutedEventHandler(DecompilerTextView_Loaded);
}

15
ILSpy/TextView/DecompilerTextView.xaml

@ -1,7 +1,7 @@
<UserControl x:Class="ICSharpCode.ILSpy.TextView.DecompilerTextView" x:ClassModifier="public" x:Name="self"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="boolToVisibility" />
</UserControl.Resources>
@ -9,8 +9,13 @@
<Border BorderThickness="1,1,0,1" BorderBrush="#FF828790">
<Grid>
<ae:TextEditor Name="textEditor" FontFamily="Consolas" FontSize="10pt" IsReadOnly="True"
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" />
Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}"
Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}">
<ae:TextEditor.Resources>
<!-- prevent App-wide button style from applying to the buttons in the search box -->
<Style TargetType="{x:Type Button}" />
</ae:TextEditor.Resources>
</ae:TextEditor>
<Border Name="waitAdorner" Background="#C0FFFFFF" Visibility="Collapsed">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock FontSize="14pt">Decompiling...</TextBlock>

Loading…
Cancel
Save