/// <summary> /// Gets all fields and properties on the given <paramref name="type"/> that match the specified /// <paramref name="bindingFlags"/>. /// The resulting list of members can optionally be filtered by supplying a list of /// <paramref name="attributeTypes"/>, in which case only members decorated with at least one of /// these will be included. /// </summary> /// <param name="type">The type on which to reflect.</param> /// <param name="bindingFlags">The <see cref="BindingFlags"/> or <see cref="FasterflectFlags"/> combination /// used to define the search behavior and result filtering.</param> /// <param name="attributeTypes">The optional list of attribute types with which members should /// be decorated. If this parameter is <see langword="null"/> or empty then all fields and properties /// matching the given <paramref name="bindingFlags"/> will be included in the result.</param> /// <returns>A list of all matching fields and properties on the type. This value will never be null.</returns> public static IList <MemberInfo> FieldsAndPropertiesWith(this Type type, FasterflectFlags bindingFlags, params Type[] attributeTypes) { return(ReflectLookup.FieldsAndPropertiesWith(type, bindingFlags, attributeTypes)); }
/// <summary> /// Gets all public and non-public instance fields and properties on the given <paramref name="type"/>. /// The resulting list of members can optionally be filtered by supplying a list of /// <paramref name="attributeTypes"/>, in which case only members decorated with at least one of /// these will be included. /// </summary> /// <param name="type">The type on which to reflect.</param> /// <param name="attributeTypes">The optional list of attribute types with which members should /// be decorated. If this parameter is <see langword="null"/> or empty then all fields and properties /// will be included in the result.</param> /// <returns>A list of all matching fields and properties on the type. This value will never be null.</returns> public static IList <MemberInfo> FieldsAndPropertiesWith(this Type type, params Type[] attributeTypes) { return(ReflectLookup.FieldsAndPropertiesWith(type, attributeTypes)); }