Duality.Log.MethodInfo C# (CSharp) Method

MethodInfo() public static method

Returns a string that can be used for representing a method in log entries.
public static MethodInfo ( MethodInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.MethodInfo
includeDeclaringType bool If true, the methods declaring type is included in the returned name.
return string
        public static string MethodInfo(MethodInfo info, bool includeDeclaringType = true)
        {
            string declTypeName = Type(info.DeclaringType);
            string returnTypeName = Type(info.ReturnType);
            string[] paramNames = info.GetParameters().Select(p => Type(p.ParameterType)).ToArray();
            string[] genArgNames = info.GetGenericArguments().Select(Type).ToArray();
            return string.Format(System.Globalization.CultureInfo.InvariantCulture,
                "{4} {0}{1}{3}({2})",
                includeDeclaringType ? declTypeName + "." : "",
                info.Name,
                paramNames.ToString(", "),
                genArgNames.Length > 0 ? "<" + genArgNames.ToString(", ") + ">" : "",
                returnTypeName);
        }

Same methods

Log::MethodInfo ( MethodBase info, bool includeDeclaringType = true ) : string