Esempio n. 1
0
 /// <summary>
 /// Retrieves the steps in a sequence before the current one.
 /// </summary>
 public static IEnumerable<Step> Before(this IEnumerable<Step> steps, Step current)
 {
     foreach (var step in steps)
     {
         if (step == current) break;
         yield return step;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Retrieves the steps in a sequence after the current one.
 /// </summary>
 public static IEnumerable<Step> After(this IEnumerable<Step> steps, Step current)
 {
     var found = false;
     foreach (var step in steps)
     {
         if (found) yield return step;
         else if (step == current) found = true;
     }
 }