private MethodName AccessorMethod(string prefix) { if (EventType == null) { return(DeclaringType.GetMethod(prefix + Name).WithParametersUnspecified()); } return(DeclaringType.GetMethod(prefix + Name, EventType)); }
public override void AcceptVisitor(IProxyDefinitionVisitor proxyDefinitionVisitor) { base.AcceptVisitor(proxyDefinitionVisitor); var methodInfo = DeclaringType.GetMethod(DelegateMethodName, BindingFlags.Public | BindingFlags.Instance); proxyDefinitionVisitor.VisitMethod(methodInfo); proxyDefinitionVisitor.VisitMembers(ParentType); }
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; }
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()); }
internal MethodInfo GetMethod() => ArgumentTypes == null ? DeclaringType.GetMethod(MethodName, Helper.flag1) : DeclaringType.GetMethod(MethodName, Helper.flag1, null, ArgumentTypes, null);