📄 library.cs
字号:
using System;
namespace ABetterLibrary
{
/// <summary>
/// Summary description for Library.
/// </summary>
public class Library
{
private BookCollection m_shelf =new BookCollection();
public Library()
{
}
public void CheckIn(Book newBook)
{
m_shelf.Add(newBook);
}
public Book CheckOut(string title)
{
Book theBook =m_shelf [title ];
m_shelf.Remove(title);
return theBook;
}
public static void Main()
{
Library aLibrary =new Library();
aLibrary.CheckIn(new Book("First Book",
"Here is the text of the first book."));
aLibrary.CheckIn(new Book("Second Book",
"Here is the text of the second book."));
Book firstBook = aLibrary.CheckOut("First Book");
Console.WriteLine("The text of '{0}' is '{1}'.",
firstBook.Title,firstBook.Text);
aLibrary.CheckIn(firstBook);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -