Exemplo n.º 1
0
 public void StartService(ApplicationServiceContext context)
 {
     if (!IsInitialized)
     {
         Initialize();
     }
 }
Exemplo n.º 2
0
        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();
                }
            }
        }