Beispiel #1
0
 private Task(
     IDictionary <uint, Task> allTasks,
     uint id,
     uint parentId
     )
 {
     this.allTasks             = allTasks;
     this.parentId             = parentId;
     Id                        = id;
     hasOpenSubtasks           = new Lazy <bool>(() => Subtasks.Any(t => !t.IsExplicitlyComplete));
     hasCompletedAncestorTasks = new Lazy <bool>(() =>
     {
         return(Parent != null &&
                (Parent.IsExplicitlyComplete || Parent.HasCompletedAncestorTasks));
     });
     dependencyTasks = new Lazy <IDictionary <uint, Task> >(() =>
     {
         return(allTasks
                .Where(kvp => dependencyIds.Contains(kvp.Key))
                .ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
     });
     hasOpenDependencies = new Lazy <bool>(() =>
     {
         return(DependencyTasks.Values.Any(t => !t.IsComplete));
     });
 }