Opc.Ua.Com.Client.ParsedNodeId.Construct C# (CSharp) Method

Construct() public method

Constructs a node identifier.
public Construct ( ) : Opc.Ua.NodeId
return Opc.Ua.NodeId
        public NodeId Construct()
        {
            StringBuilder buffer = new StringBuilder();

            // add the root type.
            buffer.Append(RootType);
            buffer.Append(':');

            // add the root identifier.
            if (this.RootId != null)
            {
                for (int ii = 0; ii < this.RootId.Length; ii++)
                {
                    char ch = this.RootId[ii];

                    // escape any special characters.
                    if (ch == '&' || ch == '?')
                    {
                        buffer.Append('&');
                    }

                    buffer.Append(ch);
                }
            }

            // add the component path.
            if (!String.IsNullOrEmpty(this.ComponentPath))
            {
                buffer.Append('?');
                buffer.Append(this.ComponentPath);
            }

            // construct the node id with the namespace index provided.
            return new NodeId(buffer.ToString(), this.NamespaceIndex);
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Constructs the node id for a branch.
        /// </summary>
        /// <param name="itemId">The item id.</param>
        /// <param name="namespaceIndex">Index of the namespace.</param>
        public static NodeId ConstructIdForHdaBranch(string itemId, ushort namespaceIndex)
        {
            ParsedNodeId parsedNodeId = new ParsedNodeId();

            parsedNodeId.RootId         = itemId;
            parsedNodeId.NamespaceIndex = namespaceIndex;
            parsedNodeId.RootType       = HdaBranch;

            return(parsedNodeId.Construct());
        }
All Usage Examples Of Opc.Ua.Com.Client.ParsedNodeId::Construct