|
|
@@ -55,6 +55,11 @@ namespace System.Reflection {
|
|
|
const BindingFlags defaultBindingFlags =
|
|
|
BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
|
|
|
|
|
|
+ static Module () {
|
|
|
+ FilterTypeName = new TypeFilter (filter_by_type_name);
|
|
|
+ FilterTypeNameIgnoreCase = new TypeFilter (filter_by_type_name_ignore_case);
|
|
|
+ }
|
|
|
+
|
|
|
internal Module () { }
|
|
|
|
|
|
~Module () {
|
|
|
@@ -215,6 +220,22 @@ namespace System.Reflection {
|
|
|
return new Guid (GetGuidInternal ());
|
|
|
}
|
|
|
|
|
|
+ private static bool filter_by_type_name (Type m, object filterCriteria) {
|
|
|
+ string s = (string)filterCriteria;
|
|
|
+ if (s.EndsWith ("*"))
|
|
|
+ return m.Name.StartsWith (s.Substring (0, s.Length - 1));
|
|
|
+ else
|
|
|
+ return m.Name == s;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static bool filter_by_type_name_ignore_case (Type m, object filterCriteria) {
|
|
|
+ string s = (string)filterCriteria;
|
|
|
+ if (s.EndsWith ("*"))
|
|
|
+ return m.Name.ToLower ().StartsWith (s.Substring (0, s.Length - 1).ToLower ());
|
|
|
+ else
|
|
|
+ return String.Compare (m.Name, s, true) == 0;
|
|
|
+ }
|
|
|
+
|
|
|
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
|
|
private extern string GetGuidInternal ();
|
|
|
|