public static bool TryCreate(SeparatedSyntaxList <TNode> list, TextSpan span, out SeparatedSyntaxListSelection <TNode> selection) { selection = null; if (!list.Any()) { return(false); } if (span.IsEmpty) { return(false); } (int startIndex, int endIndex) = GetIndexes(list, span); if (startIndex == -1) { return(false); } selection = new SeparatedSyntaxListSelection <TNode>(list, span, startIndex, endIndex); return(true); }
internal static bool TryCreate(SeparatedSyntaxList <TNode> list, TextSpan span, int minCount, int maxCount, out SeparatedSyntaxListSelection <TNode> selection) { selection = Create(list, span, minCount, maxCount); return(selection != null); }
/// <summary> /// Creates a new <see cref="SeparatedSyntaxListSelection{TNode}"/> based on the specified list and span. /// </summary> /// <param name="list"></param> /// <param name="span"></param> /// <param name="selection"></param> /// <returns>True if the specified span contains at least one node; otherwise, false.</returns> public static bool TryCreate(SeparatedSyntaxList <TNode> list, TextSpan span, out SeparatedSyntaxListSelection <TNode> selection) { selection = Create(list, span, 1, int.MaxValue); return(selection != null); }
internal EnumeratorImpl(SeparatedSyntaxListSelection <TNode> selection) { _en = new Enumerator(selection); }
internal Enumerator(SeparatedSyntaxListSelection <TNode> selection) { _selection = selection; _index = -1; }