public void LoadRptFromNode(XmlElement Node) { try { key = System.Guid.NewGuid().ToString(); desc = CABCXML.GetValFromNode(Node, "desc", "报表系统"); foreach (XmlElement item in Node.ChildNodes) { string skey = item.Name; if (skey.ToLower().Substring(0, 3) == "dir") { CWLRptDir ndir = new CWLRptDir(); ndir.LoadRptFromNode(item); ndir.key = System.Guid.NewGuid().ToString(); LsDir.Add(ndir); } if (skey.ToLower().Substring(0, 3) == "rpt") { CWLRpt nrpt = new CWLRpt(); nrpt.LoadFromNode(item); nrpt.key = System.Guid.NewGuid().ToString(); nrpt.PDir = this; LsRpt.Add(nrpt); } } } catch (Exception e) { } }
public void LoadFromXML(ref string sMsg)//读取窗口文件 { sMsg = ""; try { XmlDocument myxmldoc = new XmlDocument(); myxmldoc.Load(sFIle); string xpath = "root/SysConfig"; XmlElement childNode = (XmlElement)myxmldoc.SelectSingleNode(xpath); if (childNode != null) { nSysConfig.LoadFromNode(childNode); } xpath = "root/DBConfig"; childNode = (XmlElement)myxmldoc.SelectSingleNode(xpath); if (childNode != null) { nDBConfig.LoadFromNode(childNode); } xpath = "root/ListTree"; childNode = (XmlElement)myxmldoc.SelectSingleNode(xpath); if (childNode != null) { nRpt.LoadRptFromNode(childNode); } } catch (Exception ex) { sMsg = ex.Message; } }