/// <summary> /// Determines whether the specified event is visible outside the containing assembly. /// </summary> /// <param name="eventDef">The event that is checked.</param> /// <returns><see langword="true"/> in case the event is visible outside of the assembly.</returns> /// <exception cref="ArgumentNullException"><paramref name="eventDef"/> is <see langword="null"/>.</exception> /// <remarks> /// The event is considered visible in case any of the methods related to it is visible outside. /// </remarks> public static bool IsVisibleOutside(this EventDef eventDef) { if (eventDef == null) { throw new ArgumentNullException(nameof(eventDef)); } return(eventDef.AllMethods().Any(IsVisibleOutside)); }
/// <summary> /// Determines whether the specified event is an explictly implemented interface member. /// </summary> /// <param name="evt">The event.</param> /// <returns><c>true</c> if the specified eve is an explictly implemented interface member; otherwise, <c>false</c>.</returns> public static bool IsExplicitlyImplementedInterfaceMember(this EventDef evt) { return(evt.AllMethods().Any(IsExplicitlyImplementedInterfaceMember)); }
/// <summary> /// Determines whether the specified event is static. /// </summary> /// <param name="evt">The event.</param> /// <returns><c>true</c> if the specified event is static; otherwise, <c>false</c>.</returns> public static bool IsStatic(this EventDef evt) { return(evt.AllMethods().Any(method => method.IsStatic)); }
/// <summary> /// Determines whether the specified event is family or assembly. /// </summary> /// <param name="evt">The event.</param> /// <returns><c>true</c> if the specified property is family or assembly; otherwise, <c>false</c>.</returns> public static bool IsFamilyOrAssembly(this EventDef evt) { return(evt.AllMethods().Any(method => method.IsFamilyOrAssembly)); }
/// <summary> /// Determines whether the specified event is abstract. /// </summary> /// <param name="evt">The event.</param> /// <returns><see langword="true" /> if the specified event is abstract; otherwise, <see langword="false" /></returns> public static bool IsAbstract(this EventDef evt) => evt.AllMethods().Any(method => method.IsAbstract);
/// <summary> /// Determines whether this specified event has private flags for all event methods. /// </summary> /// <param name="evt">The event.</param> /// <returns> /// <c>true</c> if the specified property is family; otherwise, <c>false</c>. /// </returns> public static bool HasAllPrivateFlags(this EventDef evt) { return(evt.AllMethods().All(method => method.HasPrivateFlags())); }