Пример #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     m_library = new Library();
     Book cookies = new Book();
     cookies.Title = "Cookies";
     cookies.Text = "Chocolate chip cookies are the most delicious cookies";
     cookies.PageLength = 8;
     Book fairyTales = new Book();
     fairyTales.Title = "Fairy Tales";
     fairyTales.Text = "Once upon a time there was a bear";
     fairyTales.PageLength = 8;
     m_library.CheckIn(cookies);
     m_library.CheckIn(fairyTales);
     listOfBooks.Items.Add(cookies.Title);
     listOfBooks.Items.Add(fairyTales.Title);
 }
Пример #2
0
        //private Library m_library;

        private void Form1_Load(object sender, EventArgs e)
        {
            Book fairyTales = new Book("Fairy Tales", "Once upon a time there was a bear.");
            Book cookies = new Book("Cookies", "Chocolate chip cookies are the most delicious cookies");
            
            Book[] m_library = new Book[] {fairyTales, cookies};

            listOfBooks.DataSource = m_library;

            //m_library = new Library();
            //Book cookies = new Book();
            //cookies.Title = "Cookies";
            //cookies.Text = "Chocolate chip cookies are the most delicious cookies";
            //cookies.PageLength = 8;
            //Book fairyTales = new Book();
            //fairyTales.Title = "Fairy Tales";
            //fairyTales.Text = "Once upon a time there was a bear";
            //fairyTales.PageLength = 8;
            //m_library.CheckIn(cookies);
            //m_library.CheckIn(fairyTales);
            //listOfBooks.Items.Add(cookies.Title);
            //listOfBooks.Items.Add(fairyTales.Title);
        }
Пример #3
0
 public  void CheckIn(Book newBook)
 {
     m_shelf.Add(newBook.Title, newBook);
 }