private bool checkMethodSignature(MethodInfo method, out ParameterInfo[] paramsInfo) { paramsInfo = null; if (method == null) return false; paramsInfo = method.GetParameters(); if (paramsInfo.Length != 2) { paramsInfo = null; return false; } var first = paramsInfo.First(); foreach (var p in paramsInfo) { if (p.ParameterType != p.ParameterType) return false; } return true; }
/// <summary> /// Adds the by suffix. /// </summary> /// <param name="parameters">The parameters.</param> /// <param name="functionName">Name of the function.</param> /// <returns></returns> internal static string AddBySuffix(ParameterInfo[] parameters, string functionName) { int paramStart = 0; if (parameters.Count() > 0 && parameters.First().Name == "self") paramStart = 1; for (int paramIndex = paramStart; paramIndex < parameters.Length; paramIndex++) { ParameterInfo parameterInfo = parameters[paramIndex]; if (paramIndex == paramStart) functionName += "By_"; else functionName += "_"; functionName += parameterInfo.Name.ToLower().ToPascalCase(); } return functionName; }