Ejemplo n.º 1
0
 public void Run <TContext>(ITaskTreeNode <TContext> taskTreeNode, TContext context)
 {
     foreach (var currentTaskTreeNode in TaskTreeNode.EnumerateAll(taskTreeNode))
     {
         currentTaskTreeNode.Task.Consume(context);
     }
 }
Ejemplo n.º 2
0
        public static IEnumerable <ITaskTreeNode <TContext> > EnumerateAll <TContext>(ITaskTreeNode <TContext> taskTreeNode)
        {
            yield return(taskTreeNode);

            if (!taskTreeNode.IsLeaf())
            {
                foreach (var child in taskTreeNode.Children)
                {
                    var childTaskTreeNodes = TaskTreeNode.EnumerateAll(child);
                    foreach (var subChild in childTaskTreeNodes)
                    {
                        yield return(subChild);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public static bool IsLeaf <TContext>(this ITaskTreeNode <TContext> taskTreeNode)
        {
            var isLeaf = TaskTreeNode.IsLeaf(taskTreeNode);

            return(isLeaf);
        }