Пример #1
0
        public static void LOAD()
        {
            string DbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "APPDATA.db");
            var    conn   = new SQLiteConnection(new SQLitePlatformWinRT(), DbPath);

            conn.CreateTable <option_data>();// 创建 option_data 模型对应的表,如果已存在,则忽略该操作。
            var db = conn.Table <option_data>();

            if (db.Count() == 0)
            {
                return;
            }
            else
            {
                option_data k = db.First();
                app_data.ISFULLSCREEN = k.ISFULLSCREEN;
                app_data.ISMUTE       = k.ISMUTE;
                app_data.ISNIGHT      = k.ISNIGHT;
                app_data.HAVEDONE     = k.HAVEDONE;
                app_data.LANGGUAGE    = k.LANGGUAGE;
                app_data.SFXVOLUME    = k.SFXVOLUME;
                app_data.MUSICVOLUME  = k.MUSICVOLUME;
                app_data.ACHIEVEMENT  = k.ACHIEVEMENT;
            }
        }
Пример #2
0
        public static void SAVE()
        {
            string DbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "APPDATA.db");
            var    conn   = new SQLiteConnection(new SQLitePlatformWinRT(), DbPath);

            conn.CreateTable <option_data>();// 创建 option_data 模型对应的表,如果已存在,则忽略该操作。
            var db = conn.Table <option_data>();
            var k  = new option_data();

            if (db.Count() == 0)
            {
                conn.Insert(k);
            }
            else
            {
                conn.DeleteAll(typeof(option_data));
                conn.Insert(k);
            }
        }