예제 #1
0
 private MethodName AccessorMethod(string prefix)
 {
     if (EventType == null)
     {
         return(DeclaringType.GetMethod(prefix + Name).WithParametersUnspecified());
     }
     return(DeclaringType.GetMethod(prefix + Name, EventType));
 }
예제 #2
0
        public override void AcceptVisitor(IProxyDefinitionVisitor proxyDefinitionVisitor)
        {
            base.AcceptVisitor(proxyDefinitionVisitor);

            var methodInfo = DeclaringType.GetMethod(DelegateMethodName, BindingFlags.Public | BindingFlags.Instance);

            proxyDefinitionVisitor.VisitMethod(methodInfo);
            proxyDefinitionVisitor.VisitMembers(ParentType);
        }
예제 #3
0
        internal MethodInfo GetMethod()
        {
            MethodInfo meth =
                ArgumentTypes == null
                    ? DeclaringType.GetMethod(MethodName, Helper.flag1)
                    : DeclaringType.GetMethod(MethodName, Helper.flag1, null, ArgumentTypes, null);

            return 
                meth.IsGenericMethod && GenericArguments != null && GenericArguments.Length > 0 
                ? meth.MakeGenericMethod(GenericArguments) 
                : meth;
        }
예제 #4
0
 public sealed override DmdMethodInfo GetGenericMethodDefinition()
 {
     if (!IsGenericMethodDefinition)
     {
         throw new InvalidOperationException();
     }
     if ((object)ReflectedType == DeclaringType)
     {
         return(this);
     }
     return(DeclaringType.GetMethod(Module, MetadataToken) as DmdMethodInfo ?? throw new InvalidOperationException());
 }
예제 #5
0
 internal MethodInfo GetMethod() =>
     ArgumentTypes == null
         ? DeclaringType.GetMethod(MethodName, Helper.flag1)
         : DeclaringType.GetMethod(MethodName, Helper.flag1, null, ArgumentTypes, null);