Пример #1
0
        private CozyWorker FindWorker(long id)
        {
            CozyWorker MinWorker = null;

            foreach (var worker in Workers)
            {
                if (worker.ContainsId(id))
                {
                    return(worker);
                }

                if (MinWorker == null)
                {
                    MinWorker = worker;
                }
                else
                {
                    MinWorker = MinWorker.MessageCount < worker.MessageCount ? MinWorker : worker;
                }
            }

            if (MinWorker != null)
            {
                return(MinWorker);
            }
            return(null);
        }
Пример #2
0
 public void AddWorker(CozyWorker worker)
 {
     worker.MessageCallback = MsgCallback;
     lock(Locker)
     {
         Workers.Add(worker);
     }
 }
Пример #3
0
 public void AddWorker(CozyWorker worker)
 {
     worker.MessageCallback = MsgCallback;
     lock (Locker)
     {
         Workers.Add(worker);
     }
 }