System.Diagnostics.DebuggerAttributes.GetProperty C# (CSharp) Method

GetProperty() private static method

private static GetProperty ( object obj, string propertyName ) : PropertyInfo
obj object
propertyName string
return PropertyInfo
        private static PropertyInfo GetProperty(object obj, string propertyName)
        {
            for (Type t = obj.GetType(); t != null; t = t.GetTypeInfo().BaseType)
            {
                PropertyInfo pi = t.GetTypeInfo().GetDeclaredProperty(propertyName);
                if (pi != null)
                {
                    return pi;
                }
            }
            return null;
        }