using System.Security.Permissions;
using System.Diagnostics.SymbolStore;
-#if !NET_4_5
-using TypeInfo = System.Type;
-#endif
namespace System.Reflection.Emit
{
}
}
if (binder == null)
- binder = Binder.DefaultBinder;
+ binder = DefaultBinder;
return (ConstructorInfo) binder.SelectMethod (bindingAttr, match,
types, modifiers);
}
return DefineProperty (name, attributes, 0, returnType, null, null, parameterTypes, null, null);
}
-#if NET_4_0
public PropertyBuilder DefineProperty (string name, PropertyAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
{
return DefineProperty (name, attributes, callingConvention, returnType , null, null, parameterTypes, null, null);
}
-#endif
public PropertyBuilder DefineProperty (string name, PropertyAttributes attributes, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
{
return CreateTypeInfo ();
}
-#if NET_4_5
public
-#endif
TypeInfo CreateTypeInfo ()
{
/* handle nesting_type */
/* Needed to keep signature compatibility with MS.NET */
public override EventInfo[] GetEvents ()
{
+ const BindingFlags DefaultBindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
return GetEvents (DefaultBindingFlags);
}
{
check_created ();
- bool ignoreCase = ((bindingAttr & BindingFlags.IgnoreCase) != 0);
- MethodInfo[] methods = GetMethodsByName (name, bindingAttr, ignoreCase, this);
- MethodInfo found = null;
- MethodBase[] match;
- int typesLen = (types != null) ? types.Length : 0;
- int count = 0;
-
- foreach (MethodInfo m in methods) {
- // Under MS.NET, Standard|HasThis matches Standard...
- if (callConvention != CallingConventions.Any && ((m.CallingConvention & callConvention) != callConvention))
- continue;
- found = m;
- count++;
- }
-
- if (count == 0)
- return null;
-
- if (count == 1 && typesLen == 0)
- return found;
-
- match = new MethodBase [count];
- if (count == 1)
- match [0] = found;
- else {
- count = 0;
- foreach (MethodInfo m in methods) {
- if (callConvention != CallingConventions.Any && ((m.CallingConvention & callConvention) != callConvention))
- continue;
- match [count++] = m;
- }
- }
-
- if (types == null)
- return (MethodInfo) Binder.FindMostDerivedMatch (match);
+ if (types == null)
+ return created.GetMethod (name, bindingAttr);
- if (binder == null)
- binder = Binder.DefaultBinder;
-
- return (MethodInfo)binder.SelectMethod (bindingAttr, match, types, modifiers);
+ return created.GetMethod (name, bindingAttr, binder, callConvention, types, modifiers);
}
public override Type GetNestedType (string name, BindingFlags bindingAttr)
return res;
}
- internal TypeCode GetTypeCodeInternal () {
- if (parent == pmodule.assemblyb.corlib_enum_type) {
- for (int i = 0; i < num_fields; ++i) {
- FieldBuilder f = fields [i];
- if (!f.IsStatic)
- return Type.GetTypeCode (f.FieldType);
- }
- throw new InvalidOperationException ("Enum basetype field not defined");
- } else {
- return Type.GetTypeCodeInternal (this);
- }
- }
-
void _TypeBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
{
}
}
-#if NET_4_5
public override bool IsConstructedGenericType {
get { return false; }
}
{
return base.IsAssignableFrom (typeInfo);
}
-#endif
}
}
#endif