/// <summary> /// Get tables, /// in this node, repeat X times: Return my tables then return the tables of my children /// </summary> /// <param name="node"></param> /// <returns>Stream of tables to be consumed</returns> private IEnumerable <ExecutionTable> GetOrderedTables(ExecutionNode node) { for (long i = 1; i < node.RepeatCount + 1; i++) { if (cancelationToken.IsCancellationRequested) { break; } foreach (var table in node.Tables) { if (cancelationToken.IsCancellationRequested) { break; } yield return(new ExecutionTable(table, i)); } if (node.Children.Any(x => true)) { foreach (var child in node.Children) { foreach (var m in GetOrderedTables(child)) { yield return(m); } } } } }
public NodeIterator(ExecutionEntities.ExecutionNode node) { ValidateUtil.ValidateNotNull(node, "node"); cancelationToken = new System.Threading.CancellationTokenSource(); this.executionNode = node; }