public static PathDataDriverDoc LoadObj() { PathDataDriverDoc pDoc; XmlSerializer xmlSerializer = new XmlSerializer(typeof(PathDataDriverDoc)); FileStream fsReader = null; try { fsReader = File.OpenRead(@".//Parameter/PathDoc" + ".xml"); pDoc = (PathDataDriverDoc)xmlSerializer.Deserialize(fsReader); fsReader.Close(); pDoc.m_pathDataDriverDictionary = pDoc.m_pathDataDriverList.ToDictionary(p => p.Name); } catch //(Exception eMy) { if (fsReader != null) { fsReader.Close(); } pDoc = new PathDataDriverDoc(); } return(pDoc); }
static public void InitData() { pathDoc = PathDataDriverDoc.LoadObj(); }