public static MethodTranslationInfo FromMethodInfo(MethodBase methodInfo, ClassTranslationInfo classTranslationInfo) { var result = new MethodTranslationInfo { ScriptName = methodInfo.Name, ClassTi = classTranslationInfo }; var scriptNameAttribute = methodInfo.GetCustomAttribute <PyNameAttribute>(); if (scriptNameAttribute != null) { result.ScriptName = scriptNameAttribute.Name.Trim(); } if (string.IsNullOrEmpty(result.ScriptName)) { throw new Exception("Method name is empty"); } return(result); }
public MethodTranslationInfo GetOrMakeTranslationInfo(MethodBase methodInfo) { var cti = GetOrMakeTranslationInfo(methodInfo.DeclaringType); return(MethodTranslationInfo.FromMethodInfo(methodInfo, cti)); }