Ejemplo n.º 1
0
 /// <summary>
 /// Creates an operand that references a component/property of a type.
 /// </summary>
 public SimpleAttributeOperand(
     NodeId typeId,
     IList <QualifiedName> browsePath)
 {
     m_typeDefinitionId = typeId;
     m_browsePath       = new QualifiedNameCollection(browsePath);
     m_attributeId      = Attributes.Value;
     m_indexRange       = null;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a deep copy of the collection.
        /// </summary>
        /// <remarks>
        /// Creates a deep copy of the collection.
        /// </remarks>
        public object Clone() {
            QualifiedNameCollection clone = new QualifiedNameCollection(this.Count);

            foreach (QualifiedName element in this) {
                clone.Add((QualifiedName) Utils.Clone(element));
            }

            return clone;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates an operand that references a component/property of a type.
 /// </summary>
 public SimpleAttributeOperand(
     FilterContext context,
     ExpandedNodeId typeId,
     IList <QualifiedName> browsePath)
 {
     m_typeDefinitionId = ExpandedNodeId.ToNodeId(typeId, context.NamespaceUris);
     m_browsePath       = new QualifiedNameCollection(browsePath);
     m_attributeId      = Attributes.Value;
     m_indexRange       = null;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a deep copy of the collection.
        /// </summary>
        /// <remarks>
        /// Creates a deep copy of the collection.
        /// </remarks>
        public new object MemberwiseClone()
        {
            QualifiedNameCollection clone = new QualifiedNameCollection(this.Count);

            foreach (QualifiedName element in this)
            {
                clone.Add((QualifiedName)Utils.Clone(element));
            }

            return(clone);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Parses a browse path.
        /// </summary>
        public static QualifiedNameCollection Parse(string browsePath)
        {
            QualifiedNameCollection browseNames = new QualifiedNameCollection();

            if (String.IsNullOrEmpty(browsePath))
            {
                return(browseNames);
            }

            StringBuilder buffer = new StringBuilder();

            bool escaped = false;

            for (int ii = 0; ii < browsePath.Length; ii++)
            {
                char ch = browsePath[ii];

                if (escaped)
                {
                    buffer.Append(ch);
                    escaped = false;
                    continue;
                }

                if (ch == '&')
                {
                    escaped = true;
                    continue;
                }

                if (ch == '/')
                {
                    if (buffer.Length > 0)
                    {
                        QualifiedName browseName = QualifiedName.Parse(buffer.ToString());
                        browseNames.Add(browseName);
                    }

                    buffer.Length = 0;
                    continue;
                }

                buffer.Append(ch);
            }

            if (buffer.Length > 0)
            {
                QualifiedName browseName = QualifiedName.Parse(buffer.ToString());
                browseNames.Add(browseName);
            }

            return(browseNames);
        }