System.Diagnostics.DebuggerAttributes.GetProperty C# (CSharp) 메소드

GetProperty() 개인적인 정적인 메소드

private static GetProperty ( object obj, string propertyName ) : PropertyInfo
obj object
propertyName string
리턴 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;
        }