Forge/Integration/GameEngineManager.cs
/// <summary>
/// Discovers allocatable event monitors, allocates them, and then initializes them with the
/// given event notifier.
/// </summary>
/// <param name="eventNotifier">The event notifier to initialize the monitors with</param>
Discovers allocatable event monitors, allocates them, and then initializes them with the
given event notifier.
Discovers allocatable event monitors allocates them and then initializes them with the given event notifier .
private static void CreateEventMonitors(IEventNotifier eventNotifier) {
            var monitors =
                from assembly in AppDomain.CurrentDomain.GetAssemblies()
                from type in assembly.GetTypes()
                where typeof(IEventMonitor).IsAssignableFrom(type)
                where type.IsAbstract == false
                where type.IsInterface == false
                where type.IsClass == true
                where Attribute.IsDefined(type, typeof(EventMonitorAutomaticInstantiationAttribute))
                select (IEventMonitor)Activator.CreateInstance(type,  true);
            foreach (IEventMonitor monitor in monitors) {
                monitor.Initialize(eventNotifier);
            }
        }
private static void CreateEventMonitors ( IEventNotifier eventNotifier ) { var monitors = from assembly in AppDomain . CurrentDomain . GetAssemblies ( ) from type in assembly . GetTypes ( ) where typeof ( IEventMonitor ) . IsAssignableFrom ( type ) where type . IsAbstract == false where type . IsInterface == false where type . IsClass == true where Attribute . IsDefined ( type , typeof ( EventMonitorAutomaticInstantiationAttribute ) ) select ( IEventMonitor ) Activator . CreateInstance ( type , true ) ; foreach ( IEventMonitor monitor in monitors ) { monitor . Initialize ( eventNotifier ) ; } }
Discovers allocatable event monitors, allocates them, and then initializes them with the
given event notifier.
Discovers allocatable event monitors allocates them and then initializes them with the given event notifier .
/*nonPublic:*/
eventNotifier
IEventNotifier
The event notifier to initialize the monitors with
The event notifier to initialize the monitors with