Example #1
0
        /// <summary>
        /// 将配置持久化保存
        /// </summary>
        void SaveAllToPersistent()
        {
            DataSet   ds = new DataSet();
            DataTable dt = new DataTable();

            dt.Columns.Add("Key");
            dt.Columns.Add("TypeName");
            dt.Columns.Add("Value");

            foreach (var profileDict in ContextDict)
            {
                DataTable dt1 = dt.Clone();
                dt1.TableName = profileDict.Key;

                foreach (var profile in profileDict.Value)
                {
                    dt1.Rows.Add(profile.Key, profile.Value.TypeName, profile.Value.Value);
                }
                ds.Tables.Add(dt1);
            }
            mDataSetLoader.SaveData(ds);
        }