Esempio n. 1
0
 /// <summary>
 /// add step
 /// </summary>
 /// <param name="step"></param>
 public void AddStep(WorkingCopyStep step)
 {
     if (Steps == null)
     {
         Steps = new List <WorkingCopyStep>();
     }
     Steps.Add(step);
 }
Esempio n. 2
0
        private static IEnumerable <WorkingCopyStep> FindSteps(WorkingCopy work, WorkingCopyStep startStep, string endStepCode)
        {
            List <WorkingCopyStep> steps = new List <WorkingCopyStep>();

            if (startStep.Code == endStepCode)
            {
                return(steps);
            }
            var nextSteps = work.Flows.Where(x => x.FromStep.Contains(startStep)).SelectMany(x => x.ToStep?.Steps).ToList().Distinct();

            steps.AddRange(nextSteps);
            if (nextSteps?.Any() == true)
            {
                steps.AddRange(nextSteps.SelectMany(x => FindSteps(work, x, endStepCode)));
            }
            return(steps);
        }
Esempio n. 3
0
 /// <summary>
 /// constructor for one step
 /// </summary>
 /// <param name="step"></param>
 public WorkingCopyFlowSeed(WorkingCopyStep step)
 {
     Steps = new List <WorkingCopyStep> {
         step
     };
 }
Esempio n. 4
0
 /// <summary>
 /// determine if this seed contains the step
 /// </summary>
 /// <param name="step"></param>
 /// <returns></returns>
 public bool Contains(WorkingCopyStep step)
 {
     return(Steps?.Contains(step) ?? false);
 }