diff --git a/ILSpy/AssemblyListTreeNode.cs b/ILSpy/AssemblyListTreeNode.cs
index 620b5668d..2ea490d4c 100644
--- a/ILSpy/AssemblyListTreeNode.cs
+++ b/ILSpy/AssemblyListTreeNode.cs
@@ -48,7 +48,6 @@ namespace ICSharpCode.ILSpy
if (assemblyList == null)
throw new ArgumentNullException("assemblyList");
this.assemblyList = assemblyList;
- this.FilterSettings = new FilterSettings(); // default filter
}
public override bool CanDelete(SharpTreeNode[] nodes)
diff --git a/ILSpy/AssemblyTreeNode.cs b/ILSpy/AssemblyTreeNode.cs
index 4175a5777..765a519fc 100644
--- a/ILSpy/AssemblyTreeNode.cs
+++ b/ILSpy/AssemblyTreeNode.cs
@@ -197,5 +197,14 @@ namespace ICSharpCode.ILSpy
return null;
}
}
+
+ public override FilterResult Filter(FilterSettings settings)
+ {
+ // avoid accessing this.AssemblyDefinition (waiting for background thread) if settings.SearchTerm == null
+ if (settings.SearchTerm == null || settings.SearchTermMatches(this.AssemblyDefinition.Name.Name))
+ return FilterResult.Match;
+ else
+ return FilterResult.Recurse;
+ }
}
}
diff --git a/ILSpy/CueBannerService.cs b/ILSpy/CueBannerService.cs
new file mode 100644
index 000000000..e9d3919c5
--- /dev/null
+++ b/ILSpy/CueBannerService.cs
@@ -0,0 +1,198 @@
+// Copyright (c) 2008 Jason Kemp
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Documents;
+using System.Windows.Media;
+
+namespace ICSharpCode.ILSpy
+{
+ ///
+ /// Watermark for text boxes; from http://www.ageektrapped.com/blog/the-missing-net-4-cue-banner-in-wpf-i-mean-watermark-in-wpf/.
+ ///
+ public static class CueBannerService
+ {
+ //there is absolutely no way to write this statement out
+ //to look pretty
+ public static readonly DependencyProperty CueBannerProperty = DependencyProperty.RegisterAttached(
+ "CueBanner", typeof (object), typeof (CueBannerService),
+ new FrameworkPropertyMetadata("", CueBannerPropertyChanged));
+
+ public static object GetCueBanner(Control control)
+ {
+ return control.GetValue(CueBannerProperty);
+ }
+
+ public static void SetCueBanner(Control control, object value)
+ {
+ control.SetValue(CueBannerProperty, value);
+ }
+
+ private static void CueBannerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ Control control = (Control)d;
+ control.Loaded += control_Loaded;
+ if (d is ComboBox || d is TextBox)
+ {
+ control.GotFocus += control_GotFocus;
+ control.LostFocus += control_Loaded;
+ }
+ if (d is ItemsControl && !(d is ComboBox))
+ {
+ ItemsControl i = (ItemsControl) d;
+ //for Items property
+ i.ItemContainerGenerator.ItemsChanged += ItemsChanged;
+ itemsControls.Add(i.ItemContainerGenerator, i);
+ //for ItemsSource property
+ DependencyPropertyDescriptor prop =
+ DependencyPropertyDescriptor.FromProperty(ItemsControl.ItemsSourceProperty, i.GetType());
+ prop.AddValueChanged(i, ItemsSourceChanged);
+ }
+ }
+
+ private static readonly Dictionary