private void OnSubmitAddNewBook() { if (null != this.notification) { Book book = new Book(); book.BookName = BookName; book.CoverImg = BookCoverImg; book.MediaFile = BookMediaPath; book.Category = Book.ParseBookCategory(this.BookCategory); book.BookUri = BookUri; this.notification.AddedBook = book; this.notification.Confirmed = true; } this.FinishInteraction(); }
private void FocusBookChanged(Book book) { if (null != book) { BookMedia = book.MediaFile; } else { BookMedia = ""; } }
private void FocusBookChanged(Book book) { if (null != book) { BookCover = book.CoverImg; } else { BookCover = ""; } }
private void FocusBookChanged(Book book) { if (null != book) { BookUri = book.BookUri; } else { BookUri = ""; } }
private static bool LoadBooks() { if (Properties.Settings.Default.MyBooks.Length < 1) { _Books = new List<Book>(); Book book = new Book(); book.BookName = "WPF高级编程"; book.CoverImg = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf1.jpg"); book.MediaFile = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf.mp4"); book.Category = Book.BookCategory.ScienceTech; _Books.Add(book); book = new Book(); book.BookName = "WPF高级编程"; book.CoverImg = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf1.jpg"); book.MediaFile = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf.mp4"); book.Category = Book.BookCategory.ScienceTech; _Books.Add(book); book = new Book(); book.BookName = "WPF高级编程"; book.CoverImg = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf1.jpg"); book.MediaFile = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf.mp4"); book.Category = Book.BookCategory.ScienceTech; _Books.Add(book); book = new Book(); book.BookName = "WPF高级编程"; book.CoverImg = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf1.jpg"); book.MediaFile = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf.mp4"); book.Category = Book.BookCategory.ScienceTech; _Books.Add(book); book = new Book(); book.BookName = "WPF高级编程"; book.CoverImg = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf1.jpg"); book.MediaFile = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "res", "wpf.mp4"); book.Category = Book.BookCategory.ScienceTech; _Books.Add(book); } else { ParseBooksItems(Properties.Settings.Default.MyBooks); } return true; }
private void OnViewBookInfo(Object obj) { Book book = (Book)obj; this._currentBook = book; eventAggregator.GetEvent<FocusBookChangedEvent>().Publish(book); }
private void OnRemoveBook() { if (null != this._currentBook) { BooksManager.RemoveBook(this._currentBook); this._currentBook = null; OnViewBookInfo(null); } }
private static void AppendLastBlankBookForAddNew(int rows, List<ShelfRowBooks> bookRows) { if (bookRows[rows - 1].BookCount == ShelfRowBooks.BOOKS_PER_ROW) { ShelfRowBooks blankRow = new ShelfRowBooks(); Book blankBook = new Book(); blankRow.Books[0] = blankBook; blankRow.BookCount = 1; bookRows.Add(blankRow); } else { ShelfRowBooks lastRow = bookRows[rows - 1]; lastRow.Books[lastRow.BookCount] = new Book(); lastRow.BookCount++; } }
public static void RemoveBook(Book book) { _Books.Remove(book); }
public static void AddBookLibrary(Book newBook) { _Books.Add(newBook); }
static void ParseBooksItems(String items) { _Books = new List<Book>(); string[] books = items.Split(';'); foreach (string book in books) { if (string.IsNullOrEmpty(book)) { continue; } string[] entries = book.Split(','); if (entries.Length < 4) { continue; } //Book.BookCategory cat = Book.ParseBookCategory(entries[1]); Book b = new Book(entries[0], Book.BookCategory.Other, entries[2], entries[3]); b.BookUri = entries[1]; _Books.Add(b); } }