// Violates this rule
        public static Book FromPages(string[] pages)
        {
            if (pages == null)
                throw new ArgumentNullException("pages");

            Book book = new Book();

            foreach (string page in pages)
            {
                book.Pages.Add(page);
            }             return book;
        }
 public void Remove(Book value)
 {
     InnerList.Remove(value);
 }
 public void Insert(int index, Book value)
 {
     InnerList.Insert(index, value);
 }
 public int IndexOf(Book value)
 {
     return InnerList.IndexOf(value);
 }
 public void CopyTo(Book[] array, int arrayIndex)
 {
     InnerList.CopyTo(array, arrayIndex);
 }
 public bool Contains(Book value)
 {
     return InnerList.Contains(value);
 }
 public void Add(Book value)
 {
     InnerList.Add(value);
 }
コード例 #8
0
 // 打印书名。
 private static void PrintTitle(Book b)
 {
     Console.WriteLine("   {0}", b.Title);
 }
コード例 #9
0
 internal void AddBookToTotal(Book book)
 {
     countBooks += 1;
     priceBooks += book.Price;
 }