private void timer_Elapsed(object sender, ElapsedEventArgs e) { ApplicationSession.Invoker.BeginInvoke(new Action(() => { if (ActiveThoughts.Count == 0) { return; } if (ReviewSession != null) { ReviewSession.RepostCurrent(); } Message message = ActiveThoughts[ActiveThoughts.Count - 1]; ActiveThoughts.Remove(message); RaiseUpdate("ActiveThoughts"); StaleThoughts.Add(message); RaiseUpdate("StaleThoughts"); ReviewSession = new MessageReviewSession(message, result => { if (result.Status == Status.Active) { ActiveThoughts.Insert(0, result); RaiseUpdate("ActiveThoughts"); } ReviewSession = null; RaiseUpdate("ReviewSession"); }); RaiseUpdate("ReviewSession"); }), null); }
public void DismissFocusedActiveThought() { Message message = FocusedActiveThought; // TODO: Add availabilities if (message == null) { return; } message.Status = Status.Stale; messageRepository.WriteStaleMessage(message); ActiveThoughts.Remove(message); StaleThoughts.Add(message); messageRepository.SaveThoughts(ActiveThoughts); RaiseUpdate("ActiveThoughts"); }