Opc.Ua.Com.Client.DaModelUtils.ConstructIdForDaElement C# (CSharp) Method

ConstructIdForDaElement() public static method

Constructs a NodeId from the ItemId for a DA branch.
public static ConstructIdForDaElement ( string itemId, int propertyId, ushort namespaceIndex ) : Opc.Ua.NodeId
itemId string The item id.
propertyId int The property id.
namespaceIndex ushort Index of the namespace.
return Opc.Ua.NodeId
        public static NodeId ConstructIdForDaElement(string itemId, int propertyId, ushort namespaceIndex)
        {
            DaParsedNodeId parsedNodeId = new DaParsedNodeId();

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

            if (propertyId >= 0)
            {
                parsedNodeId.PropertyId = propertyId;
                parsedNodeId.RootType = DaProperty;
            }

            return parsedNodeId.Construct();
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Initializes the node from the element.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="element">The element.</param>
        /// <param name="namespaceIndex">Index of the namespace.</param>
        public void Initialize(ISystemContext context, DaElement element, ushort namespaceIndex)
        {
            m_element = element;

            if (element == null)
            {
                return;
            }

            this.NodeId      = DaModelUtils.ConstructIdForDaElement(element.ItemId, -1, namespaceIndex);
            this.BrowseName  = new QualifiedName(element.Name, namespaceIndex);
            this.DisplayName = new LocalizedText(element.Name);
        }
All Usage Examples Of Opc.Ua.Com.Client.DaModelUtils::ConstructIdForDaElement