public static DateTime addMonitored(Monitored mm) { DateTime key = DateTime.Now; lock(List) { while(true) { try { List.Add(key, mm); mm.Started = key; if(Display != null) { try { Display.RebuildGui(); // thread safe method, can call here } catch { } } break; } catch { key = key.AddTicks(-1); } } } return key; }
public static void markComplete(Monitored mm, bool success, string comment) { if(mm != null) { mm.Complete = true; mm.Finished = DateTime.Now; mm.Success = success; if(comment != null) { mm.Comment = comment + " " + mm.Comment; } WorkValues(); // make sure values are updated on display } }