using System.Runtime.CompilerServices;
using System.Diagnostics;
-namespace Mono.CSharp {
+namespace Mono.MonoBASIC {
public class TypeManager {
//
static public Type char_ptr_type;
static public Type short_type;
static public Type decimal_type;
+ static public Type date_type;
static public Type bool_type;
static public Type sbyte_type;
static public Type byte_type;
static public Expression system_int32_expr, system_uint32_expr;
static public Expression system_int64_expr, system_uint64_expr;
static public Expression system_char_expr, system_void_expr;
+ static public Expression system_date_expr;
static public Expression system_asynccallback_expr;
static public Expression system_iasyncresult_expr;
//
static public ConstructorInfo cons_param_array_attribute;
static public ConstructorInfo void_decimal_ctor_five_args;
+ static public ConstructorInfo void_datetime_ctor_ticks_arg;
static public ConstructorInfo unverifiable_code_ctor;
// <remarks>
// This is the type_cache from the assemblies to avoid
// hitting System.Reflection on every lookup.
// </summary>
- static Hashtable types;
+ static CaseInsensitiveHashtable types;
// <remarks>
// This is used to hotld the corresponding TypeContainer objects
// since we need this in FindMembers
// </remarks>
- static Hashtable typecontainers;
+ static CaseInsensitiveHashtable typecontainers;
// <remarks>
// Keeps track of those types that are defined by the
static Hashtable indexer_arguments;
// <remarks>
- // Maybe `method_arguments' should be replaced and only
+ // Maybe 'method_arguments' should be replaced and only
// method_internal_params should be kept?
// <remarks>
static Hashtable method_internal_params;
system_uint64_expr = new TypeLookupExpression ("System.UInt64");
system_char_expr = new TypeLookupExpression ("System.Char");
system_void_expr = new TypeLookupExpression ("System.Void");
+ system_date_expr = new TypeLookupExpression ("System.DateTime");
system_asynccallback_expr = new TypeLookupExpression ("System.AsyncCallback");
system_iasyncresult_expr = new TypeLookupExpression ("System.IAsyncResult");
}
modules = null;
user_types = new ArrayList ();
- types = new Hashtable ();
- typecontainers = new Hashtable ();
+ types = new CaseInsensitiveHashtable ();
+ typecontainers = new CaseInsensitiveHashtable ();
builder_to_declspace = new PtrHashtable ();
builder_to_attr = new PtrHashtable ();
//
// This probably never happens, as we catch this before
//
- Report.Error (-17, "The type `" + name + "' has already been defined.");
+ Report.Error (-17, "The type '" + name + "' has already been defined.");
return;
}
tc = builder_to_declspace [t] as TypeContainer;
Report.Warning (
- 1595, "The type `" + name + "' is defined in an existing assembly;"+
+ 1595, "The type '" + name + "' is defined in an existing assembly;"+
" Using the new definition from: " + tc.Location);
Report.Warning (1595, "Previously defined in: " + prev.Assembly.FullName);
}
/// <summary>
- /// Returns the TypeContainer whose Type is `t' or null if there is no
- /// TypeContainer for `t' (ie, the Type comes from a library)
+ /// Returns the TypeContainer whose Type is 't' or null if there is no
+ /// TypeContainer for 't' (ie, the Type comes from a library)
/// </summary>
public static TypeContainer LookupTypeContainer (Type t)
{
n [top] = a;
assemblies = n;
+
+ foreach(Type type in a.GetTypes()) {
+ if (type.IsPublic ) // && type. attributed as standard module
+ AddStandardModule(type);
+ }
}
/// <summary>
modules = n;
}
+
+ private class StandardModule {
+ public readonly string Namespace;
+ public readonly string Name;
+ public StandardModule(string _namespace, string name) { Namespace = _namespace; Name = name; }
+ public override string ToString() { return ((Namespace != null && Namespace.Length > 0)?(Namespace + "."):"") + Name; }
+ }
+
+ private static StandardModule[] standardModules;
+
+ /// <summary>
+ /// Registers a new 'standard module' to lookup short-qualified or unqualified members
+ /// </summary>
+ internal static void AddStandardModule(Module module)
+ {
+ int top = standardModules != null ? standardModules.Length : 0;
+ StandardModule [] n = new StandardModule [top + 1];
+
+ if (standardModules != null)
+ standardModules.CopyTo (n, 0);
+ string name = module.Name;
+ int split = name.LastIndexOf('.');
+ if (split > 0)
+ name = name.Substring(split+1);
+ n [top] = new StandardModule(module.Namespace.Name, name);
+ //Console.WriteLine("Standard Module added:" + module.Name + " [" + n [top] + "]");
+ standardModules = n;
+ }
+
+ ///
+ /// Registers a existing 'standard module' to lookup short-qualified or unqualified members
+ ///
+ private static void AddStandardModule(Type type)
+ {
+ object[] attributes = type.GetCustomAttributes(false);
+ for (int i = 0; i < attributes.Length; i ++) {
+ if (attributes[i].ToString() == "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute") {
+ int top = standardModules != null ? standardModules.Length : 0;
+ StandardModule [] n = new StandardModule [top + 1];
+
+ if (standardModules != null)
+ standardModules.CopyTo (n, 0);
+ n [top] = new StandardModule(type.Namespace, type.Name) ;
+ standardModules = n;
+
+ return;
+ }
+ }
+ }
+
+ //
+ //
+ //
+ public static Type[] GetPertinentStandardModules(string[] namespaces)
+ {
+ ArrayList list = new ArrayList();
+ foreach(string Namespace in namespaces)
+ {
+ for(int i = 0; i < standardModules.Length; i++)
+ if (standardModules[i].Namespace == Namespace) {
+ string name = standardModules[i].ToString();
+ Type t = LookupType(name);
+ if (t == null) {
+ System.Console.WriteLine("Could not find standard module '" + name + "'");
+ }
+ else {
+ list.Add(t);
+ }
+ }
+ }
+ return (Type[])list.ToArray(typeof(Type));
+ }
+
//
// Low-level lookup, cache-less
//
{
Type t;
- foreach (Assembly a in assemblies){
- t = a.GetType (name);
- if (t != null)
- return t;
- }
+ try {
+ foreach (Assembly a in assemblies){
+ t = a.GetType (name, false, true);
+ if (t != null)
+ return t;
+ }
- foreach (ModuleBuilder mb in modules) {
- t = mb.GetType (name);
- if (t != null){
- return t;
+ foreach (ModuleBuilder mb in modules) {
+ t = mb.GetType (name, false, true);
+ if (t != null){
+ return t;
+ }
}
+ } catch (Exception e) {
+ System.Console.WriteLine("\nERROR: " + e.ToString() + "WHILE EXECUTING LookupTypeReflection(\"" + name + "\")\n");
}
return null;
}
//
// Returns a list of all namespaces in the assemblies and types loaded.
//
- public static Hashtable GetNamespaces ()
+ public static CaseInsensitiveHashtable GetNamespaces ()
{
- Hashtable namespaces = new Hashtable ();
+ CaseInsensitiveHashtable namespaces = new CaseInsensitiveHashtable ();
- foreach (Assembly a in assemblies){
- foreach (Type t in a.GetTypes ()){
+ foreach (Assembly a in assemblies) {
+ foreach (Type t in a.GetTypes ()) {
string ns = t.Namespace;
if (namespaces.Contains (ns))
}
}
- foreach (ModuleBuilder mb in modules){
- foreach (Type t in mb.GetTypes ()){
+ foreach (ModuleBuilder mb in modules) {
+ foreach (Type t in mb.GetTypes ()) {
string ns = t.Namespace;
if (namespaces.Contains (ns))
namespaces [ns] = ns;
}
}
+
return namespaces;
}
/// <summary>
/// Returns the C# name of a type if possible, or the full type name otherwise
/// </summary>
- static public string CSharpName (Type t)
+ static public string MonoBASIC_Name (Type t)
{
return Regex.Replace (t.FullName,
@"^System\." +
- @"(Int32|UInt32|Int16|Uint16|Int64|UInt64|" +
- @"Single|Double|Char|Decimal|Byte|SByte|Object|" +
- @"Boolean|String|Void)" +
+ @"(Int32|Int16|Int64|Single|Double|Char|Decimal|Byte|Object|Boolean|String|DateTime)" +
@"(\W+|\b)",
- new MatchEvaluator (CSharpNameMatch));
+ new MatchEvaluator (MonoBASIC_NameMatch));
}
- static String CSharpNameMatch (Match match)
+ static String MonoBASIC_NameMatch (Match match)
{
string s = match.Groups [1].Captures [0].Value;
return s.ToLower ().
- Replace ("int32", "int").
- Replace ("uint32", "uint").
+ Replace ("int32", "integer").
Replace ("int16", "short").
- Replace ("uint16", "ushort").
Replace ("int64", "long").
- Replace ("uint64", "ulong").
- Replace ("single", "float").
- Replace ("boolean", "bool")
+ Replace ("datetime", "date")
+ match.Groups [2].Captures [0].Value;
}
/// <summary>
/// Returns the signature of the method
/// </summary>
- static public string CSharpSignature (MethodBase mb)
+ static public string MonoBASIC_Signature (MethodBase mb)
{
string sig = "(";
Type t = LookupType (name);
if (t == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
+ Report.Error (518, "The predefined type '" + name + "' is not defined or imported");
Environment.Exit (0);
}
}
/// <summary>
- /// Returns the MethodInfo for a method named `name' defined
- /// in type `t' which takes arguments of types `args'
+ /// Returns the MethodInfo for a method named 'name' defined
+ /// in type 't' which takes arguments of types 'args'
/// </summary>
static MethodInfo GetMethod (Type t, string name, Type [] args)
{
sig.name = name;
sig.args = args;
- list = FindMembers (t, MemberTypes.Method, instance_and_static | BindingFlags.Public,
+ list = FindMembers (t, MemberTypes.Method, instance_and_static | BindingFlags.Public| BindingFlags.IgnoreCase,
signature_filter, sig);
if (list.Count == 0) {
- Report.Error (-19, "Can not find the core function `" + name + "'");
+ Report.Error (-19, "Can not find the core function '" + name + "'");
return null;
}
MethodInfo mi = list [0] as MethodInfo;
if (mi == null) {
- Report.Error (-19, "Can not find the core function `" + name + "'");
+ Report.Error (-19, "Can not find the core function '" + name + "'");
return null;
}
/// <summary>
/// Returns the ConstructorInfo for "args"
/// </summary>
- static ConstructorInfo GetConstructor (Type t, Type [] args)
+ public static ConstructorInfo GetConstructor (Type t, Type [] args)
{
MemberList list;
Signature sig;
sig.args = args;
list = FindMembers (t, MemberTypes.Constructor,
- instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly,
+ instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase,
signature_filter, sig);
if (list.Count == 0){
- Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
+ Report.Error (-19, "Can not find the core constructor for type '" + t.Name + "'");
return null;
}
ConstructorInfo ci = list [0] as ConstructorInfo;
if (ci == null){
- Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
+ Report.Error (-19, "Can not find the core constructor for type '" + t.Name + "'");
return null;
}
array_type = CoreLookupType ("System.Array");
void_type = CoreLookupType ("System.Void");
+ date_type = CoreLookupType ("System.DateTime");
type_type = CoreLookupType ("System.Type");
runtime_field_handle_type = CoreLookupType ("System.RuntimeFieldHandle");
void_decimal_ctor_five_args = GetConstructor (
decimal_type, dec_arg);
+ // DateTime constructor
+ Type [] ticks_arg = { int64_type };
+ void_datetime_ctor_ticks_arg = GetConstructor ( date_type, ticks_arg);
+
//
// Attributes
//
const BindingFlags instance_and_static = BindingFlags.Static | BindingFlags.Instance;
- static Hashtable type_hash = new Hashtable ();
+ static CaseInsensitiveHashtable type_hash = new CaseInsensitiveHashtable ();
/// <remarks>
/// This is the "old", non-cache based FindMembers() function. We cannot use
MemberFilter filter, object criteria)
{
DeclSpace decl = (DeclSpace) builder_to_declspace [t];
-
+ bf |= BindingFlags.IgnoreCase;
//
- // `builder_to_declspace' contains all dynamic types.
+ // 'builder_to_declspace' contains all dynamic types.
//
if (decl != null) {
MemberList list;
//
if ((bf & instance_and_static) == instance_and_static){
MemberInfo [] i_members = t.FindMembers (
- mt, bf & ~BindingFlags.Static, filter, criteria);
+ mt, (bf & ~BindingFlags.Static) | BindingFlags.IgnoreCase, filter, criteria);
int i_len = i_members.Length;
if (i_len == 1){
}
MemberInfo [] s_members = t.FindMembers (
- mt, bf & ~BindingFlags.Instance, filter, criteria);
+ mt, (bf & ~BindingFlags.Instance) | BindingFlags.IgnoreCase, filter, criteria);
int s_len = s_members.Length;
if (i_len > 0 || s_len > 0)
/// <summary>
/// This method is only called from within MemberLookup. It tries to use the member
- /// cache if possible and falls back to the normal FindMembers if not. The `used_cache'
+ /// cache if possible and falls back to the normal FindMembers if not. The 'used_cache'
/// flag tells the caller whether we used the cache or not. If we used the cache, then
/// our return value will already contain all inherited members and the caller don't need
/// to check base classes and interfaces anymore.
}
//
- // If this is a dynamic type, it's always in the `builder_to_declspace' hash table
+ // If this is a dynamic type, it's always in the 'builder_to_declspace' hash table
// and we can ask the DeclSpace for the MemberCache.
//
if (t is TypeBuilder) {
MemberList list;
Timer.StartTimer (TimerType.FindMembers);
- list = decl.FindMembers (mt, bf | BindingFlags.DeclaredOnly,
+ list = decl.FindMembers (mt, bf | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase,
FilterWithClosure_delegate, name);
Timer.StopTimer (TimerType.FindMembers);
used_cache = false;
if (t == object_type || t == string_type || t == int32_type || t == uint32_type ||
t == int64_type || t == uint64_type || t == float_type || t == double_type ||
t == char_type || t == short_type || t == decimal_type || t == bool_type ||
- t == sbyte_type || t == byte_type || t == ushort_type || t == void_type)
+ t == sbyte_type || t == byte_type || t == ushort_type || t == void_type ||
+ t == date_type)
return true;
else
return false;
//
public static bool IsUnmanagedType (Type t)
{
- if (IsBuiltinType (t))
+ if (IsBuiltinType (t) && t != TypeManager.string_type)
return true;
+
if (IsEnumType (t))
return true;
+
if (t.IsPointer)
return true;
if (IsValueType (t)){
- //
- // FIXME: Check that every field in the struct is Unmanaged
- //
+ if (t is TypeBuilder){
+ TypeContainer tc = LookupTypeContainer (t);
+ foreach (Field f in tc.Fields){
+ if (f.FieldBuilder.IsStatic)
+ continue;
+ if (!IsUnmanagedType (f.FieldBuilder.FieldType))
+ return false;
+ }
+ } else {
+ FieldInfo [] fields = t.GetFields ();
+
+ foreach (FieldInfo f in fields){
+ if (f.IsStatic)
+ continue;
+ if (!IsUnmanagedType (f.FieldType))
+ return false;
+ }
+ }
return true;
}
-
+
return false;
}
}
//
- // Checks whether `type' is a subclass or nested child of `parent'.
+ // Checks whether 'type' is a subclass or nested child of 'parent'.
//
public static bool IsSubclassOrNestedChildOf (Type type, Type parent)
{
}
//
- // Checks whether `type' is a nested child of `parent'.
+ // Checks whether 'type' is a nested child of 'parent'.
//
public static bool IsNestedChildOf (Type type, Type parent)
{
}
}
- public static Hashtable TypeContainers {
+ public static CaseInsensitiveHashtable TypeContainers {
get {
return typecontainers;
}
return (Type []) indexer_arguments [indexer];
else if (indexer is PropertyBuilder)
// If we're a PropertyBuilder and not in the
- // `indexer_arguments' hash, then we're a property and
+ // 'indexer_arguments' hash, then we're a property and
// not an indexer.
return NoTypes;
else {
// This is a workaround the fact that GetValue is not
// supported for dynamic types
// </remarks>
- static Hashtable fields = new Hashtable ();
+ static CaseInsensitiveHashtable fields = new CaseInsensitiveHashtable ();
static public bool RegisterFieldValue (FieldBuilder fb, object value)
{
if (fields.Contains (fb))
return fields [fb];
}
- static Hashtable fieldbuilders_to_fields = new Hashtable ();
+ static CaseInsensitiveHashtable fieldbuilders_to_fields = new CaseInsensitiveHashtable ();
static public bool RegisterFieldBase (FieldBuilder fb, FieldBase f)
{
if (fieldbuilders_to_fields.Contains (fb))
return (FieldBase) fieldbuilders_to_fields [fb];
}
- static Hashtable events;
+ static CaseInsensitiveHashtable events;
static public bool RegisterEvent (MyEventBuilder eb, MethodBase add, MethodBase remove)
{
if (events == null)
- events = new Hashtable ();
+ events = new CaseInsensitiveHashtable ();
if (events.Contains (eb))
return false;
return ei.GetAddMethod ();
}
- static Hashtable priv_fields_events;
+ static CaseInsensitiveHashtable priv_fields_events;
static public bool RegisterPrivateFieldOfEvent (EventInfo einfo, FieldBuilder builder)
{
if (priv_fields_events == null)
- priv_fields_events = new Hashtable ();
+ priv_fields_events = new CaseInsensitiveHashtable ();
if (priv_fields_events.Contains (einfo))
return false;
return (MemberInfo) priv_fields_events [ei];
}
- static Hashtable properties;
+ static CaseInsensitiveHashtable properties;
static public bool RegisterProperty (PropertyBuilder pb, MethodBase get, MethodBase set)
{
if (properties == null)
- properties = new Hashtable ();
+ properties = new CaseInsensitiveHashtable ();
if (properties.Contains (pb))
return false;
return true;
}
- //
- // FIXME: we need to return the accessors depending on whether
- // they are visible or not.
- //
- static public MethodInfo [] GetAccessors (PropertyInfo pi)
- {
- MethodInfo [] ret;
-
- if (pi is PropertyBuilder){
- Pair pair = (Pair) properties [pi];
-
- ret = new MethodInfo [2];
- ret [0] = (MethodInfo) pair.First;
- ret [1] = (MethodInfo) pair.Second;
-
- return ret;
- } else {
- MethodInfo [] mi = new MethodInfo [2];
-
- //
- // Why this and not pi.GetAccessors?
- // Because sometimes index 0 is the getter
- // sometimes it is 1
- //
- mi [0] = pi.GetGetMethod (true);
- mi [1] = pi.GetSetMethod (true);
-
- return mi;
- }
- }
-
static public MethodInfo GetPropertyGetter (PropertyInfo pi)
{
if (pi is PropertyBuilder){
return (MethodInfo) de.Second;
} else
- return pi.GetSetMethod ();
+ return pi.GetSetMethod (true);
}
static public MethodInfo GetPropertySetter (PropertyInfo pi)
return (MethodInfo) de.First;
} else
- return pi.GetGetMethod ();
+ return pi.GetGetMethod (true);
}
/// <summary>
}
/// <summary>
- /// This function returns the interfaces in the type `t'. Works with
+ /// This function returns the interfaces in the type 't'. Works with
/// both types and TypeBuilders.
/// </summary>
public static Type [] GetInterfaces (Type t)
//
// FIXME OPTIMIZATION:
// as soon as we hit a non-TypeBuiler in the interface
- // chain, we could return, as the `Type.GetInterfaces'
+ // chain, we could return, as the 'Type.GetInterfaces'
// will return all the interfaces implement by the type
// or its parents.
//
NumberFormatInfo provider = ci.NumberFormat;
//
- // We must use Type.Equals() here since `conversionType' is
+ // We must use Type.Equals() here since 'conversionType' is
// the TypeBuilder created version of a system type and not
// the system type itself. You cannot use Type.GetTypeCode()
// on such a type - it'd always return TypeCode.Object.
return TypeManager.uint64_type;
case TypeCode.String:
return TypeManager.string_type;
+ case TypeCode.DateTime:
+ return TypeManager.date_type;
default:
if (t == typeof (void))
return TypeManager.void_type;
Report.Error (
208, loc,
"Cannot take the address or size of a variable of a managed type ('" +
- CSharpName (t) + "')");
+ MonoBASIC_Name (t) + "')");
return false;
}
/// Returns the name of the indexer in a given type.
/// </summary>
/// <remarks>
- /// The default is not always `Item'. The user can change this behaviour by
+ /// The default is not always 'Item'. The user can change this behaviour by
/// using the DefaultMemberAttribute in the class.
///
- /// For example, the String class indexer is named `Chars' not `Item'
+ /// For example, the String class indexer is named 'Chars' not 'Item'
/// </remarks>
public static string IndexerPropertyName (Type t)
{
}
//
- // We copy methods from `new_members' into `target_list' if the signature
+ // We copy methods from 'new_members' into 'target_list' if the signature
// for the method from in the new list does not exist in the target_list
//
// The name is assumed to be the same.
if (a.TypeId == TypeManager.obsolete_attribute_type){
ObsoleteAttribute oa = (ObsoleteAttribute) a;
- string method_desc = TypeManager.CSharpSignature (mb);
+ string method_desc = TypeManager.MonoBASIC_Signature (mb);
if (oa.IsError) {
- Report.Error (619, loc, "Method `" + method_desc +
- "' is obsolete: `" + oa.Message + "'");
+ Report.Error (619, loc, "Method '" + method_desc +
+ "' is obsolete: '" + oa.Message + "'");
return MethodFlags.IsObsoleteError;
} else
- Report.Warning (618, loc, "Method `" + method_desc +
- "' is obsolete: `" + oa.Message + "'");
+ Report.Warning (618, loc, "Method '" + method_desc +
+ "' is obsolete: '" + oa.Message + "'");
flags |= MethodFlags.IsObsolete;
static internal bool FilterWithClosure (MemberInfo m, object filter_criteria)
{
//
- // Hack: we know that the filter criteria will always be in the `closure'
+ // Hack: we know that the filter criteria will always be in the 'closure'
// fields.
//
return true;
//
- // Ugly: we need to find out the type of `m', and depending
+ // Ugly: we need to find out the type of 'm', and depending
// on this, tell whether we accept or not
//
if (m is MethodBase){
if (!IsSubclassOrNestedChildOf (closure_invocation_type, mb.DeclaringType))
return false;
- // Although a derived class can access protected members of its base class
- // it cannot do so through an instance of the base class (CS1540).
- if ((closure_invocation_type != closure_start_type) &&
- closure_invocation_type.IsSubclassOf (closure_start_type))
- return false;
-
return true;
}
static MemberFilter FilterWithClosure_delegate = new MemberFilter (FilterWithClosure);
//
- // Looks up a member called `name' in the `queried_type'. This lookup
- // is done by code that is contained in the definition for `invocation_type'.
+ // Looks up a member called 'name' in the 'queried_type'. This lookup
+ // is done by code that is contained in the definition for 'invocation_type'.
//
- // The binding flags are `bf' and the kind of members being looked up are `mt'
+ // The binding flags are 'bf' and the kind of members being looked up are 'mt'
//
// Returns an array of a single element for everything but Methods/Constructors
// that might return multiple matches.
ArrayList method_list = null;
Type current_type = queried_type;
+ if (queried_type == null)
+ throw new ArgumentNullException("queried_type");
bool searching = (original_bf & BindingFlags.DeclaredOnly) == 0;
bool private_ok;
bool always_ok_flag = false;
MemberList list;
//
- // `NonPublic' is lame, because it includes both protected and
+ // 'NonPublic' is lame, because it includes both protected and
// private methods, so we need to control this behavior by
// explicitly tracking if a private method is ok or not.
//
} else
private_ok = always_ok_flag;
- if (private_ok || invocation_type.IsSubclassOf (current_type))
+ if (invocation_type.IsSubclassOf (current_type))
+ private_ok = true;
+
+ if (private_ok)
bf = original_bf | BindingFlags.NonPublic;
} else {
private_ok = false;
closure_queried_type = current_type;
Timer.StopTimer (TimerType.MemberLookup);
-
+ bf |= BindingFlags.IgnoreCase;
list = MemberLookup_FindMembers (current_type, mt, bf, name, out used_cache);
Timer.StartTimer (TimerType.MemberLookup);
if (list.Count == 0)
continue;
-
+
//
- // Events and types are returned by both `static' and `instance'
+ // Events and types are returned by both 'static' and 'instance'
// searches, which means that our above FindMembers will
// return two copies of the same.
//
if (mt == MemberTypes.Event)
return new MemberList (type.GetEvents (bf | BindingFlags.DeclaredOnly));
else
- return new MemberList (type.FindMembers (mt, bf | BindingFlags.DeclaredOnly,
+ return new MemberList (type.FindMembers (mt, bf | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase,
null, null));
}