Opc.Ua.BaseInstanceState.Export C# (CSharp) Method

Export() protected method

Exports a copy of the node to a node table.
protected Export ( ISystemContext context, Node node ) : void
context ISystemContext The context.
node Node The node to update with the values from the instance.
return void
        protected override void Export(ISystemContext context, Node node)
        {
            base.Export(context, node);

            if (this.Parent != null)
            {
                NodeId referenceTypeId = this.ReferenceTypeId;
                
                if (NodeId.IsNull(referenceTypeId))
                {
                    referenceTypeId = ReferenceTypeIds.HasComponent;
                }

                node.ReferenceTable.Add(referenceTypeId, true, this.Parent.NodeId);
            }

            if (!NodeId.IsNull(this.TypeDefinitionId))
            {
                node.ReferenceTable.Add(ReferenceTypeIds.HasTypeDefinition, false, this.TypeDefinitionId);
            }

            if (!NodeId.IsNull(this.ModellingRuleId))
            {
                node.ReferenceTable.Add(ReferenceTypeIds.HasModellingRule, false, this.ModellingRuleId);
            }            
        }