Пример #1
0
        public async Task CreatTable()
        {
            if (await isDataBaseExist() == false)
            {
                SQLiteAsyncConnection conn = GetConn();
                await conn.CreateTableAsync <DB_TimePeriodList>();

                await conn.CreateTableAsync <DB_TimePointList>();

                await conn.CreateTableAsync <DB_Friend>();

                await conn.CreateTableAsync <DB_More>();

                insert_TimePeriodList(new DB_TimePeriodList("游戏", 1, false));
                insert_TimePeriodList(new DB_TimePeriodList("微博", 15, false));
                insert_TimePointList(new DB_TimePointList("睡觉", new TimeSpan(20, 30, 30), false));
                insert_TimePointList(new DB_TimePointList("学习", new TimeSpan(20, 30, 30), false));
                DB_More_Controll moreControll = new DB_More_Controll();
                moreControll.insertUpdate_More(new DB_More("Asuka", "anta baka?", 1, "\\more\\avatar.jpg"));
            }
            await _get_timePeriodList();
            await _get_timePointList();
        }
Пример #2
0
        private async void Test_More()
        {
            StorageFolder applicationFolder = ApplicationData.Current.LocalFolder;
            await applicationFolder.CreateFolderAsync("more", CreationCollisionOption.ReplaceExisting);

            StorageFolder imageFolder = await applicationFolder.GetFolderAsync("more");

            await imageFolder.CreateFileAsync("avatar.jpg", CreationCollisionOption.ReplaceExisting);

            StorageFile imageFile = await imageFolder.GetFileAsync("avatar.jpg");

            StorageFile inFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Resource/avatar_test.jpg"));

            await inFile.CopyAndReplaceAsync(imageFile);

            DB_More_Controll moreControll = new DB_More_Controll();
            DB_More          more         = await moreControll.get_more();

            more_nickName.Text     = more.nickName;
            more_sex.SelectedIndex = more.sex;
            avatar_img.Source      = new BitmapImage(new Uri(applicationFolder.Path + more.avatarPath));
            more_declaration.Text  = more.declaration;
        }