예제 #1
0
 internal Category(TaskCollection collection)
 {
     if (collection == null)
     {
         throw new System.ArgumentNullException("collection");
     }
     _collection = collection;
     id          = _collection.GetUnusedId();
 }
예제 #2
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> ();
        }