Exemplo n.º 1
0
 private void Initialize()
 {
     GlobalBooksDictionary = new Dictionary <string, Book>();
     ArtAndDesign          = new ArtAndDesign(this);
     Fiction = new Fiction(this);
     Kid     = new Kid(this);
 }
Exemplo n.º 2
0
        public override void GetBooks()
        {
            var fiction1 = new Fiction(Category.Fiction, "Svetlana", "Captivated by You", 5, "BookImages/Fiction/Captivated by You.png");
            var fiction2 = new Fiction(Category.Fiction, "Chen", "Complete Dead Sea Scrolls", 4, "BookImages/Fiction/Complete Dead Sea Scrolls.png");
            var fiction3 = new Fiction(Category.Fiction, "Sandra", "Entwined With You", 8, "BookImages/Fiction/Entwined With You.png");
            var fiction4 = new Fiction(Category.Fiction, "Roy", "Gretel and the Dark", 12, "BookImages/Fiction/Gretel and the Dark.png");
            var fiction5 = new Fiction(Category.Fiction, "Roy", "The Unfinished Symphony of You and Me", 6, "BookImages/Fiction/The Unfinished Symphony of You and Me.png");

            // UI
            Task a = Task.Run(() =>
            {
                PrivateObservableBook = new ObservableCollection <Book>()
                {
                    fiction1, fiction2, fiction3, fiction4, fiction5
                };
            });

            // Global Search
            Task b = Task.Run(() =>
            {
                ClassManager.GlobalBooksDictionary.Add(fiction1.NameOfBook, fiction1);
                ClassManager.GlobalBooksDictionary.Add(fiction2.NameOfBook, fiction2);
                ClassManager.GlobalBooksDictionary.Add(fiction3.NameOfBook, fiction3);
                ClassManager.GlobalBooksDictionary.Add(fiction4.NameOfBook, fiction4);
                ClassManager.GlobalBooksDictionary.Add(fiction5.NameOfBook, fiction5);
            });

            Task.WaitAll(a, b);
        }
Exemplo n.º 3
0
        public override Book CreateAnewBook(Tuple <Category, string, string, int> bundleForNewBook)
        {
            var newFiction = new Fiction(bundleForNewBook.Item1,
                                         bundleForNewBook.Item2,
                                         bundleForNewBook.Item3,
                                         bundleForNewBook.Item4,
                                         DefultBookImage);

            AddNewBookToLists(newFiction);
            return(newFiction);
        }