Esempio n. 1
0
        public bool GetAttribute(String name, out XMLAttribute attribute)
        {
            bool success = false;

            attribute = new XMLAttribute("Error", "Couldn't get Attribute at GetAttribute(" + name + ")");
            foreach (XMLAttribute at in attributes)
            {
                if (at.Identifier == name)
                {
                    attribute = at;
                    success   = true;
                }
            }
            return(success);
        }
Esempio n. 2
0
        public void SetAttribute(XMLAttribute attribute)
        {
            bool contains = false;
            int  index    = -1;

            for (int i = 0; i < attributes.Count; i++)
            {
                if (attributes[i].Identifier == attribute.Identifier)
                {
                    contains = true;
                    index    = i;
                }
            }
            if (contains)
            {
                attributes.RemoveAt(index);
                attributes.Add(attribute);
            }
            else
            {
                attributes.Add(attribute);
            }
        }