Ejemplo n.º 1
0
        /// <summary>
        /// Gets all properties of the specified type in depth-first order.
        /// That is, properties of the furthest ancestors are returned first,
        /// and the type's own properties are returned last.
        /// </summary>
        /// <param name="type">The type whose properties are to be returned.</param>
        internal static List <PropertyInfo> GetAllPropertiesInDepthFirstOrder(this Type type)
        {
            var properties = new List <PropertyInfo>();
            var none       = new HashSet <Type>();

            type.AddPropertiesInDepthFirstOrderTo(properties, typesAlreadyVisited: none);

            return(properties);
        }