/// <summary> /// Gets a global method /// </summary> /// <param name="name">Method name</param> /// <param name="bindingAttr">Binding attributes</param> /// <param name="callConvention">Calling convention</param> /// <param name="types">Method parameter types or null</param> /// <returns></returns> public DmdMethodInfo GetMethod(string name, DmdBindingFlags bindingAttr, DmdCallingConventions callConvention, IList <DmdType> types) { if (types == null) { return(GlobalType.GetMethod(name, bindingAttr)); } return(GlobalType.GetMethod(name, bindingAttr, callConvention, types)); }
/// <summary> /// Gets a global method /// </summary> /// <param name="name">Method name</param> /// <param name="bindingAttr">Binding attributes</param> /// <param name="callConvention">Calling convention</param> /// <param name="types">Method parameter types or null</param> /// <returns></returns> public DmdMethodInfo GetMethod(string name, DmdBindingFlags bindingAttr, DmdCallingConventions callConvention, IList <Type> types) => GetMethod(name, bindingAttr, callConvention, types.ToDmdType(AppDomain));
public static bool IsMatch(DmdMethodBase method, DmdBindingFlags bindingAttr, DmdCallingConventions callConvention) => IsMatch(method, bindingAttr) && IsMatch(method, callConvention);
public static bool IsMatch(DmdMethodBase method, DmdBindingFlags bindingAttr, DmdCallingConventions callConvention, IList <DmdType> types) { if (!IsMatch(method, bindingAttr, callConvention)) { return(false); } return(IsMatch(method, types)); }
static bool IsMatch(DmdMethodBase method, DmdCallingConventions callConvention) => callConvention == DmdCallingConventions.Any || (method.CallingConvention & DmdCallingConventions.Any) == (callConvention & DmdCallingConventions.Any);