projects/Extant/Extensions/TypeExtensions.cs
/// <summary>
/// Resets all static events in static class -type-.
/// </summary>
Resets all static events in static class -type-.
Resets all static events in static class - type - .
public static void ClearAllStaticEvents(this Type type)
        {
            foreach (EventInfo eventInfo in type.GetEvents(BindingFlags.Static | BindingFlags.Public))
            {
                FieldInfo field = type.GetField(eventInfo.Name, BindingFlags.Static | BindingFlags.NonPublic);
                field.SetValue(null, null);
            }
        }
public static void ClearAllStaticEvents ( this Type type ) { foreach ( EventInfo eventInfo in type . GetEvents ( BindingFlags . Static | BindingFlags . Public ) ) { FieldInfo field = type . GetField ( eventInfo . Name , BindingFlags . Static | BindingFlags . NonPublic ) ; field . SetValue ( null , null ) ; } }
Resets all static events in static class -type-.
Resets all static events in static class - type - .
Type
this