コード例 #1
0
        /// <summary>
        /// 载入数据
        /// </summary>
        /// <returns></returns>
        public static TablesDoc LoadObj()
        {
            TablesDoc     pDoc;
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(TablesDoc));
            FileStream    fsReader      = null;

            try
            {
                fsReader = File.OpenRead(@".//Parameter/TablesDoc" + ".xml");
                pDoc     = (TablesDoc)xmlSerializer.Deserialize(fsReader);
                fsReader.Close();
                pDoc.m_tableDictionary = pDoc.m_tableDataList.ToDictionary(p => p.strTableName);
                foreach (TableData item in pDoc.m_tableDataList)
                {
                    //fileList = fileList.OrderBy(s => int.Parse(Regex.Match(s, @"\d+").Value)).ToArray();
                    item.tablePosData.tablePosItemDictionary = item.tablePosData.tablePosItemList.ToDictionary(p => p.strName);
                }
            }
            catch (Exception eMy)
            {
                if (fsReader != null)
                {
                    fsReader.Close();
                }
                pDoc = new TablesDoc();
            }
            return(pDoc);
        }
コード例 #2
0
ファイル: TableManage.cs プロジェクト: houxpGit/12
 /// <summary>
 /// 载入参数
 /// </summary>
 static public void LoadData()
 {
     tablesDoc = TablesDoc.LoadObj();
 }