Пример #1
0
 /// <summary>
 /// Gets static event.
 /// </summary>
 /// <param name="eventName">Name of event.</param>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public event.</param>
 /// <returns>Static event.</returns>
 /// <exception cref="MissingEventException">Event doesn't exist.</exception>
 public static Reflection.Event <H> RequireStatic(string eventName, bool nonPublic = false)
 => GetStatic(eventName, nonPublic) ?? throw MissingEventException.Create <T, H>(eventName);
Пример #2
0
 /// <summary>
 /// Gets instance event.
 /// </summary>
 /// <param name="eventName">Name of event.</param>
 /// <param name="nonPublic"><see langword="true"/> to reflect non-public event.</param>
 /// <returns>Instance event.</returns>
 /// <exception cref="MissingEventException">Event doesn't exist.</exception>
 public static Event <T, H> Require(string eventName, bool nonPublic = false)
 => Get(eventName, nonPublic) ?? throw MissingEventException.Create <T, H>(eventName);