示例#1
0
 /// <summary>
 /// All items in this collection of <see cref="INodeDesign"/> is added to the <paramref name="space"/>
 /// </summary>
 /// <param name="space">The address space.</param>
 internal void AddNode2AddressSpace(IAddressSpaceCreator space)
 {
     foreach (IBaseModel item in this)
     {
         INodeDesign modelItem = item as INodeDesign;
         if (modelItem != null)
         {
             modelItem.AddNode2AddressSpace(space);
         }
     }
 }
示例#2
0
        internal ITypeDesign FindType(XmlQualifiedName myType)
        {
            ITypeDesign ret = null;

            foreach (IBaseModel item in this)
            {
                INodeDesign node = item as INodeDesign;
                if ((node != null) && (node.SymbolicName == myType))
                {
                    ret = node as ITypeDesign;
                    if (ret != null)
                    {
                        break;
                    }
                }
            }
            return(ret);
        }
        /// <summary>
        /// Adds the reference of an instance declaration.
        /// </summary>
        /// <param name="reference">The reference to be added.</param>
        /// <param name="referenceParent">The reference parent.</param>
        /// <param name="typeParentID">The parent identifier of the type provisioning instance declarations - prefix to the relative reference path.</param>
        public void AddReference(Reference reference, INodeDesign referenceParent, XmlQualifiedName typeParentID)
        {
            string           _relativeName = referenceParent.CalculateReferenceRelativeName(reference.Wrapper.TargetId.Name);
            XmlQualifiedName id            = null;

            if (string.IsNullOrEmpty(_relativeName))
            {
                id = new XmlQualifiedName(InstanceIdentifier.AddSuffix(typeParentID.Name, reference.Wrapper.TargetId.Name), m_Parent.NodeID.Namespace);
            }
            else
            {
                id = new XmlQualifiedName(InstanceIdentifier.AddSuffix(typeParentID.Name, _relativeName), m_Parent.NodeID.Namespace);
            }
            ReferenceStub rs = new ReferenceStub()
            {
                Inverse       = reference.Wrapper.IsInverse,
                ReferenceType = reference.Wrapper.ReferenceType.XmlQualifiedName,
                TargetName    = id
            };

            m_References.Add(rs);
        }
示例#4
0
 /// <summary>
 /// Adds the reference from the type definition of this instance.
 /// </summary>
 /// <param name="reference">The reference.</param>
 /// <param name="referenceParent">The reference parent.</param>
 /// <param name="typeParentID">The parent identifier of the type provisioning instance declarations - prefix to the relative reference path.</param>
 void IInstanceNodeContext.AddReference(Reference reference, INodeDesign referenceParent, XmlQualifiedName typeParentID)
 {
     m_References.AddReference(reference, referenceParent, typeParentID);
 }