Example #1
0
        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> ();
        }
Example #2
0
 void IIdentificable.Initialize(TaskCollection coll)
 {
     _collection = coll;
 }