public void Startup()
{
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
foreach(var ss in services)
{
Logger.Log(string.Format("Initializing {0}", ss.Name));
ss.Service.Initialize(ss.Config, EventManager, profileStore[ss.Name]);
if(ss.Service is IComponentProvider)
{
((IComponentProvider) ss.Service).RegisterComponents(container);
}
ss.Service.Start();
Logger.Log(string.Format("Initialized {0}", ss.Name));
}
EventManager.Publish(ServiceHostState.Validate);
LogDiagnosticInformation();
EventManager.Publish(ServiceHostState.Startup);
EventManager.Subscribe(typeof(FlushProfile), FlushProfileImpl);
}