Opc.Ua.ServerTest.TranslatePathTest.AddSingleHopPaths C# (CSharp) Method

AddSingleHopPaths() private method

Adds a single hop path for all references for the node.
private AddSingleHopPaths ( Node node, BrowsePathCollection pathsToTranslate ) : void
node Node
pathsToTranslate BrowsePathCollection
return void
        private void AddSingleHopPaths(Node node, BrowsePathCollection pathsToTranslate)
        {
            ReferenceDescriptionCollection references = node.Handle as ReferenceDescriptionCollection;

            if (references == null)
            {
                return;
            }

            for (int ii = 0; ii < references.Count; ii++)
            {
                BrowsePath browsePath = new BrowsePath();
                browsePath.StartingNode = node.NodeId;
                browsePath.Handle = node;

                RelativePathElement element = new RelativePathElement();

                element.ReferenceTypeId = references[ii].ReferenceTypeId;
                element.IsInverse = !references[ii].IsForward;
                element.IncludeSubtypes = false;
                element.TargetName = references[ii].BrowseName;

                browsePath.RelativePath.Elements.Add(element);
                pathsToTranslate.Add(browsePath);
            }
        }