Example #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);
        }
Example #2
0
 public void AddWorker(CozyWorker worker)
 {
     worker.MessageCallback = MsgCallback;
     lock(Locker)
     {
         Workers.Add(worker);
     }
 }
Example #3
0
 public void AddWorker(CozyWorker worker)
 {
     worker.MessageCallback = MsgCallback;
     lock (Locker)
     {
         Workers.Add(worker);
     }
 }