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]); } }
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));
public void Register <ItemType>(Handler <ItemType> handler) where ItemType : IItem { _handlers.Add(handler); }
/// <summary> /// Добавление нового диспетчера /// </summary> /// <param name="disp">Объект диспетчера</param> public void addDispatcher(Dispatcher disp) { Dispatchers.Add(disp); dispInformator += disp.getRecommendedAltitude; }