/// <summary> /// Searches for the field, using the specified binding constraints. /// </summary> /// <param name="type">The <see cref="Type"/> to search for the field in.</param> /// <param name="name">The name of the field to find.</param> /// <param name="flags">A bitmask comprised of one or more <see cref="BindingFlags"/> that specify how the search is conducted.</param> /// <returns> /// An <see cref="IMemberAccessor"/> instance for the field if found; otherwise <c>null</c>. /// </returns> public static IMemberAccessor FindField(Type type, string name, BindingFlags flags) { if (type == null) { throw new ArgumentNullException("type"); } if (string.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } TypeAccessor typeAccessor = TypeAccessor.GetAccessor(type); IMemberAccessor memberAccessor = typeAccessor.FindField(name, flags); return(memberAccessor); }