Exemple #1
0
 public bool isPresent(CTask task)
 {
     if (listMain.ContainsValue(task))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
 public bool Add(long time, CTask task)
 {
     try
     {
         _hshMain.Add(time, task);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #3
0
 public bool Add(CTask task)
 {
     try
     {
         listMain.Add(task.ID, task);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #4
0
        public bool Delete(CTask task)
        {
            try
            {
                listMain.Remove(task.ID);

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Exemple #5
0
        /// <summary>
        /// Returns all Tasks in the Priority Order, with Task at index 0 having lowest priority
        /// </summary>
        /// <returns></returns>
        public CTask[] GetAllTasksInPriorityOrder()
        {
            SortedList tmpSortedList = new SortedList();
            int        idx           = 0;

            CTask [] array = new CTask[listMain.Count];
            foreach (CTask task in listMain.Values)
            {
                tmpSortedList.Add(task.iPriority, task);
            }


            foreach (CTask task in tmpSortedList.Values)
            {
                array[idx++] = task;
            }

            return(array);
        }