public static CameraDoc LoadObj() { CameraDoc pDoc = new CameraDoc(); try { XmlSerializer xmlSerializer = new XmlSerializer(typeof(CameraDoc)); FileStream fsReader = null; fsReader = File.OpenRead(@".//Parameter/CameraDoc.xml"); pDoc = (CameraDoc)xmlSerializer.Deserialize(fsReader); fsReader.Close(); pDoc.CamerasInfoDic = pDoc.CamerasInfoList.ToDictionary(p => p.UserID); } catch { pDoc.CamerasInfoList.Clear(); } return(pDoc); }
public static void LoadDoc() { doc = CameraDoc.LoadObj(); }