Пример #1
0
        public override Dispatcher Create(DeterministicRandom random)
        {
            lock (Dispatchers)
            {
                if (!Dispatchers.Contains(Dispatcher.CurrentDispatcher))
                {
                    //Save all Dispatchers, then we can get Dispatchers of another threads.
                    Dispatchers.Add(Dispatcher.CurrentDispatcher);
                }

                return(Dispatchers[DispatcherIndex % Dispatchers.Count]);
            }
        }
Пример #2
0
        private void AddNewDispatcher()
        {
            string nameDispatcher;

            do
            {
                Console.Clear();
                Console.Write("Имя нового диспетчера:\n" +
                              "[0] Назад;\n->");

                nameDispatcher = Console.ReadLine();
            } while (nameDispatcher.Trim().Equals(""));

            if (!nameDispatcher.Equals("0"))
            {
                Dispatchers.Add(new Dispatcher(nameDispatcher, Plane));
            }
        }
 public void AddJob(string subscriptionName, Type jobType) =>
 Dispatchers.Add(new TimeMessageDispatcher(ScopeFactory, CreateClient(subscriptionName), jobType));
Пример #4
0
 public void Register <ItemType>(Handler <ItemType> handler)
     where ItemType : IItem
 {
     _handlers.Add(handler);
 }
Пример #5
0
 /// <summary>
 ///     Добавление нового диспетчера
 /// </summary>
 /// <param name="disp">Объект диспетчера</param>
 public void addDispatcher(Dispatcher disp)
 {
     Dispatchers.Add(disp);
     dispInformator += disp.getRecommendedAltitude;
 }