Esempio n. 1
0
        // [DebuggerHidden]

        public override void deserializeFromXmlTree(XmlElement nodeNode)
        {
            this.Name = nodeNode.Attributes[MocaTreeUtil.NameAttributeName].InnerXml;
            XmlAttribute indexAttribute = XmlUtil.getXMLAttributeWithName(nodeNode, MocaTreeUtil.IndexAttributeName);

            if (indexAttribute != null)
            {
                Index = int.Parse(indexAttribute.InnerXml) | 0;
            }

            foreach (XmlElement child in nodeNode.ChildNodes)
            {
                if (child.Name == MocaTreeUtil.AttributeNodeDefaultName)
                {
                    MocaAttribute newAttribute = new MocaAttribute();
                    newAttribute.deserializeFromXmlTree(child);
                    this.Attributes.Add(newAttribute);
                    newAttribute.Parent = this;
                }
                else if (child.Name == MocaNode.ChildNodeDefaultName)
                {
                    MocaNode newChild = new MocaNode();
                    newChild.deserializeFromXmlTree(child);
                    this.Children.Add(newChild);
                    newChild.Parent = this;
                }
            }
        }
Esempio n. 2
0
        public MocaNode appendChildNode(MocaNode nodeToAppend)
        {
            MocaNode mocaNode = nodeToAppend;

            this.Children.Add(mocaNode);
            mocaNode.Parent = this;
            mocaNode.Index  = this.Children.IndexOf(mocaNode);
            return(mocaNode);
        }
Esempio n. 3
0
        public MocaNode appendChildNode(String attributeName)
        {
            MocaNode mocaNode = new MocaNode();

            mocaNode.Name = attributeName;
            this.Children.Add(mocaNode);
            mocaNode.Parent = this;
            mocaNode.Index  = this.Children.IndexOf(mocaNode);
            return(mocaNode);
        }
Esempio n. 4
0
        public MocaNode getChildNodeWithName(String childName)
        {
            MocaNode childToFind = null;

            foreach (MocaNode mocaChildNode in this.Children)
            {
                if (mocaChildNode.Name == childName)
                {
                    childToFind = mocaChildNode;
                }
            }
            return(childToFind);
        }