Пример #1
0
        public static IEnumerable <WorkflowBranch> ChildBranches(WorkflowItem startItem)
        {
            var allBranches = new List <WorkflowBranch>();

            var childBranch = new WorkflowBranch(startItem);

            if (childBranch.Childs().Any())
            {
                foreach (var child in childBranch.Childs())
                {
                    allBranches.Add(childBranch.Add(child));
                }
            }
            else
            {
                allBranches.Add(childBranch);
            }

            return(allBranches);
        }
Пример #2
0
        public static IEnumerable <WorkflowBranch> ParentBranches(WorkflowItem startItem)
        {
            var allBranches = new List <WorkflowBranch>();

            var parentBranch = new WorkflowBranch(startItem);

            if (parentBranch.Parents().Any())
            {
                foreach (var parent in parentBranch.Parents())
                {
                    allBranches.Add(parentBranch.Add(parent));
                }
            }
            else
            {
                allBranches.Add(parentBranch);
            }

            return(allBranches);
        }