internal Task(TaskCollection collection) { if (collection == null) { throw new ArgumentNullException("collection"); } _collection = collection; CreationTime = DateTime.Now; ActivityTime = SegmentedTimeSpan.Empty; _subtasks = new HashSet <int> (); _dependencyIds = new HashSet <int> (); _cats = new HashSet <int> (); _id = Collection.GetUnusedId(); }
Task(int MasterId, SegmentedTimeSpan ActivityTime, int Id, int [] Subtasks, int [] Categories, int [] Dependents) { _id = Id; Dependents = Dependents ?? new int[] { }; Subtasks = Subtasks ?? new int[] { }; Categories = Categories ?? new int[] { }; masterId = MasterId; this.ActivityTime = ActivityTime ?? SegmentedTimeSpan.Empty; _cats = new HashSet <int> (Categories); _subtasks = new HashSet <int> (Subtasks); _dependencyIds = new HashSet <int> (Dependents); }
internal Task(TaskCollection collection, Task masterTask) { if (masterTask == null) { throw new ArgumentNullException("masterTask"); } if (collection == null) { throw new ArgumentNullException("collection"); } if (!collection.Contains(masterTask)) { throw new InvalidOperationException("Master task is not in the collection"); } _id = collection.GetUnusedId(); CreationTime = DateTime.Now; masterId = masterTask.Id; masterTask._subtasks.Add(Id); ActivityTime = SegmentedTimeSpan.Empty; _cats = new HashSet <int> (); _subtasks = new HashSet <int> (); _dependencyIds = new HashSet <int> (); }
static SegmentedTimeSpan() { Empty = new SegmentedTimeSpan(); }