Headless.HtmlRadioButton.FindRelatedNodes C# (CSharp) Method

FindRelatedNodes() private method

Finds the related nodes.
private FindRelatedNodes ( ) : ReadOnlyCollection
return ReadOnlyCollection
        private ReadOnlyCollection<IXPathNavigable> FindRelatedNodes()
        {
            var form = Form;

            // We want to use the finder to build the xpath query for radio buttons
            var query = form.Find<HtmlRadioButton>().BuildElementQuery() + "[@name='" + Name + "']";

            var navigator = form.Node.GetNavigator();

            var matchingNodes = navigator.Select(query);

            var results = matchingNodes.OfType<IXPathNavigable>().ToList();

            return new ReadOnlyCollection<IXPathNavigable>(results);
        }