Ejemplo n.º 1
0
 /// <summary>
 /// Gets all fields on the given <paramref name="type"/> that match the specified <paramref name="bindingFlags"/>.
 /// </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="names">The optional list of names against which to filter the result. If this parameter is
 /// <see langword="null"/> or empty no name filtering will be applied. The default behavior is to check for an exact,
 /// case-sensitive match. Pass <see cref="FasterflectFlags.ExcludeExplicitlyImplemented"/> to exclude explicitly implemented
 /// interface members, <see cref="FasterflectFlags.PartialNameMatch"/> to locate by substring, and
 /// <see cref="FasterflectFlags.IgnoreCase"/> to ignore case.</param>
 /// <returns>A list of all matching fields on the type. This value will never be null.</returns>
 public static IList <FieldInfo> Fields(this Type type, FasterflectFlags bindingFlags, params string[] names)
 {
     return(ReflectLookup.Fields(type, bindingFlags, names));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets all public and non-public instance fields on the given <paramref name="type"/>,
 /// including fields defined on base types.
 /// </summary>
 /// <param name="type">The type on which to reflect.</param>
 /// <param name="names">The optional list of names against which to filter the result. If this parameter is
 /// <see langword="null"/> or empty no name filtering will be applied. This method will check for an exact,
 /// case-sensitive match.</param>
 /// <returns>A list of all instance fields on the type. This value will never be null.</returns>
 public static IList <FieldInfo> Fields(this Type type, params string[] names)
 {
     return(ReflectLookup.Fields(type, names));
 }