ApiExamples.MergeField.GetTextSameParent C# (CSharp) Метод

GetTextSameParent() приватный статический Метод

Retrieves text from start up to but not including the end node.
private static GetTextSameParent ( Node startNode, Node endNode ) : string
startNode Node
endNode Node
Результат string
        private static string GetTextSameParent(Node startNode, Node endNode)
        {
            if ((endNode != null) && (startNode.ParentNode != endNode.ParentNode))
                throw new ArgumentException("Start and end nodes are expected to have the same parent.");

            StringBuilder builder = new StringBuilder();
            for (Node child = startNode; !child.Equals(endNode); child = child.NextSibling)
                builder.Append(child.GetText());

            return builder.ToString();
        }