public static TableDoc LoadObj(string strFullPath, ref bool bErr) { TableDoc pDoc; XmlSerializer xml = new XmlSerializer(typeof(TableDoc)); FileStream fs = null; try { fs = File.OpenRead(strFullPath); pDoc = (TableDoc)xml.Deserialize(fs); fs.Close(); pDoc.dicTableData = pDoc.listTableData.ToDictionary(p => p.Name); foreach (TableData table in pDoc.listTableData) { table.dicTableAxisItem = table.ListTableAxesItems.ToDictionary(p => p.Name); table.dicTablePosItem = table.ListTablePosItems.ToDictionary(p => p.Name); } TableManage.strConfigFile = strFullPath; return(pDoc); } catch// (Exception ex) { if (null != fs) { fs.Close(); } pDoc = new TableDoc(); //throw; } bErr = true; return(pDoc); }
public static void LoadDoc() { bool bErr = false; docTable = TableDoc.LoadObj(ref bErr); }