예제 #1
0
		public MainPageViewModel()
		{
			DB = new DataBase();
            RefreshCollect();
            RefreshHistory();
            RefreshSaved();
		}
예제 #2
0
		private void InitStorage()
		{
			if (!StorageFileHelper.FolderExists("saved_pages"))
			{
				StorageFileHelper.CreateFolder("saved_pages");
			}

			using (var db = new DataBase())
			{
				if (!db.DatabaseExists())
                {
                    try
                    {
                        db.CreateDatabase();
                    }
                    catch
                    {
                        db.Dispose();
                        if (StorageFileHelper.FileExists("DB.sdf"))
                        {
                            StorageFileHelper.DeleteFile("DB.sdf");
                        }
                    }
				}
			}
		}