Example #1
0
 /// <summary>
 /// Reflects instance indexer property.
 /// </summary>
 /// <param name="propertyName">The name of the indexer property.</param>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public property.</param>
 /// <returns>The reflected indexer property.</returns>
 /// <exception cref="MissingPropertyException">The property doesn't exist.</exception>
 public static Indexer <T, A, V> Require(string propertyName = DefaultIndexerName, bool nonPublic = false)
 => Get(propertyName, nonPublic) ?? throw MissingPropertyException.Create <T, V>(propertyName);
Example #2
0
 /// <summary>
 /// Reflects instance property.
 /// </summary>
 /// <param name="propertyName">Name of property.</param>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public property.</param>
 /// <returns>Instance property.</returns>
 /// <exception cref="MissingPropertyException">Property doesn't exist.</exception>
 public static Property <T, V> Require(string propertyName, bool nonPublic = false)
 => Get(propertyName, nonPublic) ?? throw MissingPropertyException.Create <T, V>(propertyName);
Example #3
0
 /// <summary>
 /// Reflects static indexer property.
 /// </summary>
 /// <param name="propertyName">The name of the indexer property.</param>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public property.</param>
 /// <returns>The reflected indexer property.</returns>
 /// <exception cref="MissingPropertyException">The property doesn't exist.</exception>
 public static Reflection.Indexer <A, V> RequireStatic(string propertyName, bool nonPublic = false)
 => GetStatic(propertyName, nonPublic) ?? throw MissingPropertyException.Create <T, V>(propertyName);