Esempio n. 1
0
 private void ClearDB(object sender, RoutedEventArgs e)
 {
     using (var db1 = new SmartReaderDataContext("isostore:/SmartReader.sdf"))
     {
         if (db1.DatabaseExists() == false)
         {
             db1.DeleteDatabase();
             db1.CreateDatabase();
         }
     }
 }
Esempio n. 2
0
 private void Init()
 {
     EncodingHelper.BuildGBKToUnicodeMapping();
     ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
     Settings.Load();
     using (var db1 = new SmartReaderDataContext("isostore:/SmartReader.sdf"))
     {
         if (db1.DatabaseExists() == false)
         {
           db1.CreateDatabase();
         }
     }
 }
Esempio n. 3
0
        public void PrepareTempDB()
        {

            using (var db1 = new SmartReaderDataContext("isostore:/SmartReader.sdf"))
            {
                if (db1.DatabaseExists() == false)
                {
                    db1.CreateDatabase();
                }
            }

            Storage = PhoneStorage.GetPhoneStorageInstance();

            WebSite website = CreateFakeWebSite();
            Book book = CreateFakeBook(website);
            Chapter chapter = CreateFakeChapter(book);
            CreateFakeArticleImage(chapter);
        }
Esempio n. 4
0
        public void PrepareTempDB()
        {

            using (var db1 = new SmartReaderDataContext("isostore:/SmartReader.sdf"))
            {
                if (db1.DatabaseExists() == false)
                {
                    db1.CreateDatabase();
                }
            }

            Storage = PhoneStorage.GetPhoneStorageInstance();

            TestWebSite = GetFakeWebSite();
            TestBook = GetFakeBook(TestWebSite);
            TestTextChapter = GetFakeTextChapter(TestBook);
            TestImageChapter = GetFakeImageChapter(TestBook);
            TestBook.Chapters = new[]{ TestTextChapter, TestImageChapter};

            Storage.SaveWebSite(TestWebSite);
            Storage.SaveBook(TestBook);
            Storage.SaveChapters(TestBook.Chapters);
            //CreateFakeArticleImage(chapter);
        }