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); }
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; }