示例#1
0
文件: NodeData.cs 项目: scriptkitz/MJ
        public override bool readFromXmlElement(XmlNode pCurNode)
        {
            XmlElement ele = (XmlElement)pCurNode;

            if (ele.Name != "KeyCard")
            {
                s_errorString = "error xml type error for KeyCard";
                return(false);
            }

            if (ele.HasAttribute("faceValue") == false)
            {
                s_errorString = "error xml type KeyCard do not have faceValue attribute";
                return(false);
            }

            m_nValue = int.Parse(ele.GetAttribute("faceValue"));

            XmlNode pchild = pCurNode.FirstChild;

            while (pchild != null)
            {
                NodeContribute pnodeChild = new NodeContribute(0);
                pnodeChild.readFromXmlElement(pchild);
                addChildNode(pnodeChild);
                pchild = pchild.NextSibling;
            }
            return(true);
        }
示例#2
0
        public override bool readFromXmlElement(XmlNode pCurNode)
        {
            XmlElement ele = (XmlElement)pCurNode;
            if (ele.Name != "KeyCard")
            {
                s_errorString = "error xml type error for KeyCard";
                return false;
            }

            if (ele.HasAttribute("faceValue") == false)
            {
                s_errorString = "error xml type KeyCard do not have faceValue attribute";
                return false;
            }

            m_nValue = int.Parse(ele.GetAttribute("faceValue"));

            XmlNode pchild = pCurNode.FirstChild;
            while (pchild != null)
            {
                NodeContribute pnodeChild = new NodeContribute(0);
                pnodeChild.readFromXmlElement(pchild);
                addChildNode(pnodeChild);
                pchild = pchild.NextSibling;
            }
            return true;
        }