public bool isPresent(CTask task) { if (listMain.ContainsValue(task)) { return(true); } else { return(false); } }
public bool Add(long time, CTask task) { try { _hshMain.Add(time, task); return(true); } catch { return(false); } }
public bool Add(CTask task) { try { listMain.Add(task.ID, task); return(true); } catch { return(false); } }
public bool Delete(CTask task) { try { listMain.Remove(task.ID); return(true); } catch { return(false); } }
/// <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); }