Esempio n. 1
0
        public static Library InitializeLibrary()
        {
            var story1 = new Story("Story1", StoryType.Novella, true, "Petko");
            var story2 = new Story("Story2", StoryType.ShortStory, false, "Stanko");
            var story3 = new Story("Story3", StoryType.Novellette, true, "Cvetko");
            var story4 = new Story("Story4", StoryType.ShortStory, true, "Petko");
            var story5 = new Story("Story5", StoryType.Novella, false, "Author1");
            var story6 = new Story("Story6", StoryType.Novellette, true, "Petko");
            var story7 = new Story("Story7", StoryType.Novella, false, "Author1");

            var novel1 = new Novel("AuthorN", "Novel1", TypeOfEdition.EBook, 400);
            var novel2 = new Novel("AuthorN2", "Novel2", TypeOfEdition.Paperback, 270)
            {
                Series = "Novel", SeriesNumber = 2
            };

            var storyCollection1 = new StoryCollection("Petko", "Zbirka1", TypeOfEdition.Hardcover, 832);
            var storyCollection2 = new StoryCollection("Author1", "Zbirka2", TypeOfEdition.EBook, 327);

            storyCollection1.Stories.Add(story1);
            storyCollection1.Stories.Add(story4);
            storyCollection1.Stories.Add(story6);

            storyCollection2.Stories.Add(story5);
            storyCollection2.Stories.Add(story7);

            var anthology  = new Anthology("Editorce", "Anthology", TypeOfEdition.Audiobook, 432);
            var anthology2 = new Anthology("Editor2", "Anthology2", TypeOfEdition.EBook, 385);

            anthology.Stories.Add(story3);
            anthology.Stories.Add(story1);
            anthology2.Stories.Add(story2);
            anthology2.Stories.Add(story1);
            anthology2.Stories.Add(story6);
            Library library = new Library();

            library.Books = new List <IBook> {
                novel1, novel2, storyCollection1, storyCollection2, anthology, anthology2
            };
            return(library);


            //throw new NotImplementedException();
        }
Esempio n. 2
0
        private static Library InitializeLibrary()
        {
            Library library = new Library("National Library");

            var storyCollection = new StoryCollection("100 selected stories by O Henry", TypeOfBook.EBook, 338, "O.Henry");
            var shortStory1     = new Story {
                Title = "The Gift of the Magi", AuthorName = "O.Henry", StoryType = StoryType.ShortStory, IsItOriginalStory = true
            };
            var shortStory2 = new Story {
                Title = "A Cosmopolite in a Café", AuthorName = "O.Henry", StoryType = StoryType.ShortStory, IsItOriginalStory = true
            };
            var shortStory3 = new Story {
                Title = "Between Rounds", AuthorName = "O.Henry", StoryType = StoryType.ShortStory, IsItOriginalStory = true
            };

            storyCollection.Stories = new List <Story> {
                shortStory1, shortStory2, shortStory3
            };

            var anthology = new Anthology("Zombie vs unicorns", TypeOfBook.Hardcover, 418, "Holy black");
            var story1    = new Story {
                Title = "Love will tear us apart", AuthorName = "Alaya johnson", StoryType = StoryType.Novella, IsItOriginalStory = true
            };
            var story2 = new Story {
                Title = "Love will tear us apart", AuthorName = "Alaya johnson", StoryType = StoryType.Novella, IsItOriginalStory = true
            };

            anthology.Stories = new List <Story> {
                story1, story2
            };

            library.AddBook(new Novel("To kill a mockingbird", TypeOfBook.Papaerback, 384, "Harper Lee"));
            library.AddBook(new Novel("The Fellowship of the Ring", TypeOfBook.EBook, 423, "J. R. R. Tolkien")
            {
                Series = "The lord of the rings", SeriesNumber = 1
            });
            library.AddBook(storyCollection);
            library.AddBook(anthology);

            return(library);
        }
        public static Library InitializeLibrary()
        {
            var story1 = new Story("Story1", StoryType.Novella, true, "Name1");
            var story2 = new Story("Story2", StoryType.ShortStory, false, "Name2");
            var story3 = new Story("Story3", StoryType.Novellette, true, "Name3");
            var story4 = new Story("Story4", StoryType.ShortStory, true, "Name4");
            var story5 = new Story("Story5", StoryType.Novella, false, "Name5");

            var novel1 = new Novel("Author1", "Novel1", TypeOfEdition.EBook, 400);
            var novel2 = new Novel("Author2", "Novel2", TypeOfEdition.Paperback, 270)
            {
                Series = "Novel", SeriesNumber = 2
            };

            var storyCollection1 = new StoryCollections("Name11", "Zbirka1", TypeOfEdition.Hardcover, 832);
            var storyCollection2 = new StoryCollections("Name22", "Zbirka2", TypeOfEdition.EBook, 327);

            storyCollection1.Stories.Add(story1);
            storyCollection1.Stories.Add(story4);
            storyCollection2.Stories.Add(story5);

            var anthology1 = new Anthology("Editor01", "Anthology1", TypeOfEdition.Audiobook, 432);
            var anthology2 = new Anthology("Editor02", "Anthology2", TypeOfEdition.EBook, 385);

            anthology1.Stories.Add(story3);
            anthology1.Stories.Add(story1);
            anthology2.Stories.Add(story2);
            anthology2.Stories.Add(story1);

            Library library = new Library();

            library.Books = new List <IBook> {
                novel1, novel2, storyCollection1, storyCollection2, anthology1, anthology2
            };
            return(library);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Library thousandBooks = new Library("Thousand Books");

            Novels ulysses        = new Novels("James Joyce", "Ulysses", EditionType.Hardcover, 345, false);
            Novels theGreatGatsby = new Novels("F. Scott Fitzgerald", "The Great Gatsby", EditionType.EBook, 2222, false);
            Novels lolita         = new Novels("Vladimir Nabokov", "Lolita", EditionType.AudioBook, 422, false);
            Novels catch22        = new Novels("Joseph Heller", "Catch 22", EditionType.Paperback, 356, false);
            Novels harryPoter     = new Novels(" J. K. Rowling", "Harry Potter", EditionType.Hardcover, 4522, false);
            Novels harryPotterandtheHalfBloodPrince = new Novels("J.K. Rowling", "Harry Potter and the Half-Blood Prince", EditionType.Hardcover, 642, true);
            Novels harryPotterandTheGobletOfFire    = new Novels("J.K. Rowling", "Harry Potter and the Goblet of Fire", EditionType.Hardcover, 922, true);
            Novels harryPoterAndTheChamberOfSeacret = new Novels("J.K. Rowling", "Harry Potter And The Chamber Of Seacret", EditionType.Hardcover, 399, true);

            harryPoter.AddToSeries(harryPoterAndTheChamberOfSeacret);
            harryPoter.AddToSeries(harryPotterandTheGobletOfFire);
            harryPoter.AddToSeries(harryPotterandtheHalfBloodPrince);

            StoryCollection sticks     = new StoryCollection("Unknown", "Sticks", StoryType.ShortStory, true);
            StoryCollection victoryLap = new StoryCollection("Unknown", "Victory Lap", StoryType.Novellete, true);

            StoryCollections tenthOfDecember = new StoryCollections("George Saunders", "Tenth of December", EditionType.Paperback, 1244);

            tenthOfDecember.AddStory(sticks);
            tenthOfDecember.AddStory(victoryLap);

            Anthology      fragileThings = new Anthology("Neil Gaiman", "fantastic", EditionType.Hardcover, 360, "Fragile Things");
            StoryAnthology closingTime   = new StoryAnthology("Closing Time", "Robert Aickman", StoryType.ShortStory, true);
            StoryAnthology aLoveStory    = new StoryAnthology("A Love Story", "Waren Pleece", StoryType.ShortStory, true);

            fragileThings.AddStory(closingTime);
            fragileThings.AddStory(aLoveStory);

            thousandBooks.AddBook(harryPoter);
            thousandBooks.AddBook(tenthOfDecember);
            thousandBooks.AddBook(fragileThings);
            var allBooks = thousandBooks.GetBooks();
            //------------------------------------------------------------------------------------

            string input = Console.ReadLine();



            if (input == "novela")
            {
                PrintNovela(allBooks);
            }
            Console.WriteLine("\n----------------");

            if (input == "coll")
            {
                PrintCollectionStory(allBooks);
            }
            Console.WriteLine("\n----------------");

            if (input == "ant")
            {
                PrintAnthology(allBooks);
            }
            Console.WriteLine("\n----------------");



            //------------------------------------------------------------------------------------
            //  Print
            PrintCollectionStory(allBooks);
            Console.WriteLine("\n----------------");
            Console.WriteLine("Anthology : \n");
            PrintAnthology(allBooks);
            Console.WriteLine("\n----------------");

            Console.WriteLine("Novelas : \n");
            PrintNovela(allBooks);
            Console.WriteLine("\n----------------");

            Console.ReadLine();
        }