/// <summary> /// Connects an event listener to our message bus /// </summary> /// <param name = "listener">The event listener, which will be marshalled from another AppDomain</param> /// <param name = "context">Run context event raiser</param> /// <remarks> /// We cannot pass the message bus instance to the event listener, since the listener may be in a remote AppDomain /// </remarks> private static void RegisterEventListener(IEventListener listener, IRunContextEvents context) { context.OnRunStarted += (s, e) => listener.RunStarted(); context.OnRunFinished += (s, e) => listener.RunFinished(); context.OnFeatureStarted += (s, e) => listener.FeatureStarted(e.EventInfo); context.OnFeatureFinished += (s, e) => listener.FeatureFinished(e.EventInfo); context.OnScenarioStarted += (s, e) => listener.ScenarioStarted(e.EventInfo.Title); context.OnScenarioFinished += (s, e) => listener.ScenarioFinished(e.EventInfo); }