예제 #1
0
        public static DataDoc LoadObj()
        {
            DataDoc    pDoc = null;
            FileStream fs   = null;

            try
            {
                fs = File.OpenRead(@".//Parameter/Data/SystemData.xml");
                XmlSerializer xml = new XmlSerializer(typeof(DataDoc));
                pDoc = (DataDoc)xml.Deserialize(fs);
                fs.Close();

                pDoc.dicDataGroup = pDoc.listDataGroup.ToDictionary(p => p.strGroupName);
                foreach (DataGroup item in pDoc.listDataGroup)
                {
                    item.dicDataItem = item.listDataItem.ToDictionary(p => p.strItemName);
                }
            }
            catch (Exception)
            {
                if (null != fs)
                {
                    fs.Close();
                }
                pDoc = new DataDoc();
            }

            return(pDoc);
        }
예제 #2
0
 public static void LoadData()
 {
     docData = DataDoc.LoadObj();
 }