private void SetRootItem(ExecutionPlanItem rootItem) { if (rootItem != null) { ExecutionPlanTreeView.RootItem = rootItem; } }
private void ResolveExecutionOrder(ExecutionPlanItem nextItem, ExecutionPlanItem breakAtItem, List <T> remainingLeafItems) { do { if (nextItem == breakAtItem) { return; } nextItem.ExecutionOrder = ++_currentExecutionStep; if (nextItem.Parent == null) { return; } nextItem = nextItem.Parent; var allChildrenExecuted = nextItem.ChildItems.All(i => i.ExecutionOrder != 0); if (allChildrenExecuted) { continue; } var otherBranchItemIndex = remainingLeafItems.FindIndex(i => i.IsChildFrom(nextItem)); if (otherBranchItemIndex == -1) { return; } var otherBranchLeafItem = remainingLeafItems[otherBranchItemIndex]; remainingLeafItems.RemoveAt(otherBranchItemIndex); ResolveExecutionOrder(otherBranchLeafItem, nextItem, remainingLeafItems); } while (true); }
public bool IsChildFrom(ExecutionPlanItem parent) { var item = this; do { item = item.Parent; } while (item != null && item != parent); return item != null; }
public bool IsChildFrom(ExecutionPlanItem parent) { var item = this; do { item = item.Parent; } while (item != null && item != parent); return(item != null); }
public void AddChildItem(ExecutionPlanItem childItem) { _childItems.Add(childItem); childItem.Parent = this; }