public bool Dequeue(Scheduled s) { try { jobs.Remove(s); return(true); } catch (ArgumentException) { return(false); } }
public bool Enqueue(Scheduled s, Action a) { try { jobs.Add(s, a); return(true); } catch (ArgumentException) { return(false); } }
public bool Dequeue(Scheduled s) { if (jobs.ContainsKey(s.Frequency) == false) { return(false); } try { jobs[s.Frequency].Remove(s); return(true); } catch (Exception) { return(false); } }
public bool Enqueue(Scheduled s, Action a) { if (jobs.ContainsKey(s.Frequency) == false) { jobs.Add(s.Frequency, new Dictionary <Scheduled, Action>(10)); } try { jobs[s.Frequency].Add(s, a); return(true); } catch (ArgumentException) { return(false); } }