Example #1
0
        public static HardwareDoc LoadObj()
        {
            HardwareDoc   pDoc;
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(HardwareDoc));
            FileStream    fsReader      = null;

            try
            {
                fsReader = File.OpenRead(@".//Parameter/HardwareDoc" + ".xml");
                pDoc     = (HardwareDoc)xmlSerializer.Deserialize(fsReader);
                fsReader.Close();
                pDoc.m_HardWareDictionary = pDoc.m_HardWareList.ToDictionary(p => p.hardwareName);
            }
            catch //(Exception eMy)
            {
                if (fsReader != null)
                {
                    fsReader.Close();
                }
                pDoc = new HardwareDoc();
            }
            return(pDoc);
        }
Example #2
0
 static public void LoadData()
 {
     hardDoc = HardwareDoc.LoadObj();
 }