public void LoadFromXML(string aFile) { int i = 0; XmlNode lRoot = null; XmlDocument lXMLDoc = new XmlDocument(); lXMLDoc.Load(aFile); XmlNodeList lRootSet = lXMLDoc.ChildNodes; for (int j = 0; j < lRootSet.Count; j++) { if (lRootSet[j].Name == "report-collection") { lRoot = lRootSet[j]; break; } } if (lRoot == null) { throw new Exception("Invalid report collection file!"); } else { if (i < lRoot.ChildNodes.Count) { RootFolder.BuildFromXML(lRoot.ChildNodes[i]); } ApplyToGUI(); } _LastFile = aFile; setModified(false); }
public void LoadFromXML(string aFile) { int i = 0; XmlNode lRoot = null; XmlDocument lXMLDoc = new XmlDocument(); lXMLDoc.Load(aFile); XmlNodeList lRootSet = lXMLDoc.ChildNodes; for (int j = 0; j < lRootSet.Count; j++) { if (lRootSet[j].Name == "report-collection") { lRoot = lRootSet[j]; break; } } if (lRoot == null) { ReportSmart.Controls.CRSMessageBox.ShowBox("Hibás fájl!", "Hiba"); } else { while (lRoot.ChildNodes.Count > i && lRoot.ChildNodes[i].Name != "folder") { ReportSmart.Controls.CRSMessageBox.ShowBox(lRoot.ChildNodes[i].Name, "DEBUG"); i++; } if (i < lRoot.ChildNodes.Count) { RootFolder.BuildFromXML(lRoot.ChildNodes[i]); } ApplyToGUI(); } _LastFile = aFile; setModified(false); }
public void LoadFromXML(string aFile) { #if DEBUG System.Diagnostics.Debugger.Log(0, "FileOperation", "Loading collection: " + aFile + "\n"); #endif int i = 0; XmlNode lRoot = null; XmlDocument lXMLDoc = new XmlDocument(); lXMLDoc.Load(aFile); XmlNodeList lRootSet = lXMLDoc.ChildNodes; for (int j = 0; j < lRootSet.Count; j++) { if (lRootSet[j].Name == "report-collection") { lRoot = lRootSet[j]; break; } } if (lRoot == null) { throw new Exception("Invalid report collection file!"); } else { if (i < lRoot.ChildNodes.Count) { RootFolder.BuildFromXML(lRoot.ChildNodes[i]); } ApplyToGUI(); } _LastFile = aFile; setModified(false); }