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