Esempio n. 1
0
 internal VirtualMethodInfo(string name,
                            Type declaringType,
                            Type reflectedType,
                            MethodAttributes attributes,
                            ParameterInfo[] parameters = null,
                            MethodInfo baseDefinition  = null,
                            Delegate del = null)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     if (declaringType == null)
     {
         throw new ArgumentNullException(nameof(declaringType));
     }
     if (reflectedType == null)
     {
         throw new ArgumentNullException(nameof(reflectedType));
     }
     this.parameters     = parameters ?? new ParameterInfo[] { };
     Name                = name;
     DeclaringType       = declaringType;
     ReflectedType       = reflectedType;
     Attributes          = attributes;
     this.baseDefinition = baseDefinition;
     this.del            = del;
     MetadataToken       = VirtualMemberMetadataTokenAllocator.AllocateToken();
     MethodHandle        = new RuntimeMethodHandle();
 }
Esempio n. 2
0
 internal VirtualPropertyInfo(string name,
                              Type declaringType,
                              Type reflectedType,
                              Type propertyType,
                              VirtualMethodInfo getMethod,
                              VirtualMethodInfo setMethod,
                              PropertyAttributes attributes,
                              VirtualPropertyInfo baseDefinition)
 {
     if (declaringType == null)
     {
         throw new ArgumentNullException(nameof(declaringType));
     }
     if (reflectedType == null)
     {
         throw new ArgumentNullException(nameof(reflectedType));
     }
     if (propertyType == null)
     {
         throw new ArgumentNullException(nameof(propertyType));
     }
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     DeclaringType  = declaringType;
     ReflectedType  = reflectedType;
     PropertyType   = propertyType;
     this.getMethod = getMethod;
     this.setMethod = setMethod;
     Name           = name;
     Attributes     = attributes;
     BaseDefinition = baseDefinition ?? this;
     MetadataToken  = VirtualMemberMetadataTokenAllocator.AllocateToken();
 }