Duality.Log.PropertyInfo C# (CSharp) Method

PropertyInfo() public static method

Returns a string that can be used for representing a property in log entries.
public static PropertyInfo ( PropertyInfo info, bool includeDeclaringType = true ) : string
info System.Reflection.PropertyInfo
includeDeclaringType bool If true, the properties declaring type is included in the returned name.
return string
        public static string PropertyInfo(PropertyInfo info, bool includeDeclaringType = true)
        {
            string declTypeName = Type(info.DeclaringType);
            string propTypeName = Type(info.PropertyType);
            string[] paramNames = info.GetIndexParameters().Select(p => Type(p.ParameterType)).ToArray();
            return string.Format(System.Globalization.CultureInfo.InvariantCulture,
                "{0} {1}{2}{3}",
                propTypeName,
                includeDeclaringType ? declTypeName + "." : "",
                info.Name,
                paramNames.Any() ? "[" + paramNames.ToString(", ") + "]" : "");
        }