示例#1
0
        /// <summary>
        /// Adds the <see cref="IInstanceNode" /> to the collection of a type children with goal to build inheritance chain and override the attributes of the base type by the derived type.
        /// </summary>
        /// <param name="childItem">The child item of the <paramref name="modelParentNode" />.</param>
        /// <param name="modelParentNode">The model parent node - the node, which type is processed and <paramref name="childItem" /> added.</param>
        /// <param name="typeParentID">The parent identifier of the type provisioning instance declarations - prefix to the relative reference path.</param>
        void IInstanceNodesCollection.Add(IInstanceNode childItem, IInstanceNodeContext modelParentNode, XmlQualifiedName typeParentID)
        {
            XmlQualifiedName _itemNodeID       = InstanceIdentifier.AddSuffix(modelParentNode.NodeID, childItem.SymbolicName.Name);
            string           _stringItemNodeID = InstanceIdentifier.NodeId(_itemNodeID);

            if (this.m_dictionary.ContainsKey(_stringItemNodeID))
            {
                this.m_dictionary[_stringItemNodeID].AddInstanceDeclarationOf(childItem, typeParentID);
            }
            else
            {
                this.Add(_stringItemNodeID, childItem, _itemNodeID, modelParentNode.AddressSpaceIndex, true);
            }
        }
示例#2
0
        void IInstanceNodesCollection.Add(IInstanceNode childItem, XmlQualifiedName parentNodeID, int parentAddressSpaceIndex, bool isInstanceDeclaration)
        {
            XmlQualifiedName _itemNodeID       = InstanceIdentifier.AddSuffix(parentNodeID, childItem.SymbolicName.Name);
            string           _stringItemNodeId = InstanceIdentifier.NodeId(_itemNodeID);

            if (!this.m_dictionary.ContainsKey(_stringItemNodeId))
            {
                this.Add(_stringItemNodeId, childItem, _itemNodeID, parentAddressSpaceIndex, isInstanceDeclaration);
            }
            else
            {
                string _msg = String.Format("The node {0} is declared twice and has been removed from the model", childItem.SymbolicName.ToString());
                m_compiler.Assert(false, parentAddressSpaceIndex, _msg);
            }
        }