Beispiel #1
0
 public bool Dequeue(Scheduled s)
 {
     try
     {
         jobs.Remove(s);
         return(true);
     }
     catch (ArgumentException)
     {
         return(false);
     }
 }
Beispiel #2
0
 public bool Enqueue(Scheduled s, Action a)
 {
     try
     {
         jobs.Add(s, a);
         return(true);
     }
     catch (ArgumentException)
     {
         return(false);
     }
 }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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);
            }
        }