public BookIndexPage() { InitializeComponent(); var temp = ModelManager.GetBookIndexModel(); _storage = PhoneStorage.GetPhoneStorageInstance(); temp.Book.Chapters = _storage.GetChaptersByBook(temp.Book); Model = temp; }
public static PhoneStorage GetPhoneStorageInstance() { if (_instance == null) { if (_db == null) _db = new SmartReaderDataContext(SmartReaderDataContext.DBConnectionString); _instance = new PhoneStorage(_db); } return _instance; }
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); }
public BookListModel() { _storage = PhoneStorage.GetPhoneStorageInstance(); BookList = _storage.GetAllBooks(); }
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); }