示例#1
0
        static void Main(string[] args)
        {
            Book book1 = new Book();

            book1.Title = "Wilbur's Wonderful Life";

            Shelf.Add(book1);

            foreach (var book in Shelf.arrayOfBooks)
            {
                Console.WriteLine(book.Title);
            }

            Console.Write("Please enter a book title: ");
            string input = Console.ReadLine();

            Book book2 = new Book();

            book2.Title = input;

            Shelf.Add(book2);

            foreach (var book in Shelf.arrayOfBooks)
            {
                Console.WriteLine(book.Title);
            }
            Console.Read();
        }
示例#2
0
        public void AddShelf(string name)
        {
            Shelf shelf = new Shelf(name);

            shelves.Add(shelf);
        }
示例#3
0
 public void AssignShelf(Shelf shelf)
 {
     _shelf = shelf;
     _shelf.AssignBook(this);
 }