public void Stop() { lock (runningLock) { restClient = null; room = null; running = false; } imageManager.Stop(); }
public void Start() { lock (runningLock) { if (running) { Stop(); } restClient = new CampfireRestClient(restConfiguration); room = null; foreach (CampfireRoom r in restClient.Rooms()) { if (roomName.Equals(r.Name)) { room = r; break; } } if (room == null) { throw new Exception(String.Format("Could not find room '{0}'", roomName)); } CampfireMessage lastMessage = restClient.Messages(room).Last(); if (lastMessage != null) { hwm = lastMessage.Id; } running = true; } new Thread(delegate() { imageManager.Start(); }).Start(); }