public void StartService(ApplicationServiceContext context) { if (!IsInitialized) { Initialize(); } }
protected override void OnStartup(StartupEventArgs e) { _applicationServiceContext = new ApplicationServiceContext(); // maybe should parse in the startup args foreach (IApplicationService _service in this.ApplicationLifetimeObjects) { _service.StartService(_applicationServiceContext); if (_service is IApplicationLifetimeAware) { ((IApplicationLifetimeAware)_service).Starting(); } } base.OnStartup(e); foreach (IApplicationService service in this.ApplicationLifetimeObjects) { if (service is IApplicationLifetimeAware) { ((IApplicationLifetimeAware)service).Started(); } } }