Esempio n. 1
0
 public static void Start(IReadOnlyList <IServices> services,
                          IReadOnlyList <IController> Controllers)
 {
     if (!IsApplicationStarted)
     {
         var dict = new Dictionary <Type, IController>(Controllers.Count);
         foreach (var item in Controllers)
         {
             dict.Add(item.GetType(), item);
         }
         allControllers = dict;
         FillContainers(services);
         IsApplicationStarted = true;
         ApplicationStartEvent?.Invoke();
     }
 }
Esempio n. 2
0
 public static void Start(IReadOnlyList <IServices> newServices,
                          IReadOnlyList <IController> Controllers)
 {
     if (!IsApplicationStarted)
     {
         var dict = new Dictionary <Type, IController>(Controllers.Count);
         foreach (var item in Controllers)
         {
             dict.Add(item.GetType(), item);
         }
         allControllers = dict;
         for (int i = 0; i < newServices.Count; i++)
         {
             newServices[i].Init();
         }
         Services             = new ServicesHolder(newServices);
         IsApplicationStarted = true;
         ApplicationStartEvent?.Invoke();
     }
 }