Ejemplo n.º 1
0
 /// <summary>
 /// Adds all elements of a RawProtoCollection to this collection.
 /// </summary>
 /// <param name="col">Specifies the collection to add.</param>
 public void Add(RawProtoCollection col)
 {
     foreach (RawProto rp in col)
     {
         m_rgItems.Add(rp);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// The RawProto constructor.
        /// </summary>
        /// <param name="strName">Specifies the name of the node.</param>
        /// <param name="strValue">Specifies the value of the node.</param>
        /// <param name="rgChildren">Specifies the children nodes of this node (if any).</param>
        /// <param name="type">Specifies the type of the node.</param>
        public RawProto(string strName, string strValue, RawProtoCollection rgChildren = null, TYPE type = TYPE.NONE)
        {
            m_type     = type;
            m_strName  = strName;
            m_strValue = strValue;

            if (rgChildren != null)
            {
                m_rgChildren = rgChildren;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Searches for all children with a given name in this node's children.
        /// </summary>
        /// <param name="rgstrName">Specifies a array of names to look for.</param>
        /// <returns>The collection of child nodes found is returned.</returns>
        public RawProtoCollection FindChildren(params string[] rgstrName)
        {
            RawProtoCollection rg = new RawProtoCollection();

            foreach (RawProto p in m_rgChildren)
            {
                if (rgstrName.Contains(p.Name))
                {
                    rg.Add(p);
                }
            }

            return(rg);
        }