/// <summary> /// Finds the following. /// </summary> /// <param name="element">The element.</param> /// <returns>Returns the I control flow element.</returns> private IControlFlowElement FindFollowing(IControlFlowElement element) { while (element is ControlFlowMultiplexor) { element = element.Parent; } return(element); /* * if (element == null) * { * return null; * } * * do * { * var parent = element.Parent; * if (parent != null) * { * var index = parent.Children.IndexOf(element) + 1; * if (index < parent.Children.Count) * { * return parent.Children[index]; * } * } * * element = parent; * } * while (element != null); * * return null; */ }
/// <summary> /// Finds the following. /// </summary> /// <param name="element">The element.</param> /// <returns>Returns the I control flow element.</returns> private IControlFlowElement FindFollowing(IControlFlowElement element) { while (element is ControlFlowMultiplexor) { element = element.Parent; } return element; /* if (element == null) { return null; } do { var parent = element.Parent; if (parent != null) { var index = parent.Children.IndexOf(element) + 1; if (index < parent.Children.Count) { return parent.Children[index]; } } element = parent; } while (element != null); return null; */ }