本文整理汇总了C#中Book.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Book.ToString方法的具体用法?C# Book.ToString怎么用?C# Book.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
Book readyPlayerOne = new Book("Ready Player One", "Ernest Cline", 16.90);
Console.WriteLine(readyPlayerOne.ToString());
GoldenEditionBook fahrenheit = new GoldenEditionBook("Fahrenheit 451", "Ray Bradbury", 11.90);
Console.WriteLine(fahrenheit.ToString());
}
示例2: Main
static void Main()
{
var book = new Book("Pod Igoto", "Vazov", 15.6);
var goldenBook = new GoldenEditionBook("Bai Ganio", "Konstantinov", 25);
Console.WriteLine(book.ToString());
Console.WriteLine(goldenBook.ToString());
}
示例3: JSONData
public string JSONData(string id)
{
Book knjiga = new Book("Knjiga test", "Desa", 1990, "sloven", "poezi", "dostopno na spletu");
string ret = "";
if (id == "DODAJ")
{
ret = knjiga.AddNewBook();
}
else if (id == "UREDI")
{
ret = knjiga.Update("Knjiga test", "Desa", 2000, "sloven", "poezi", "dostopno na spletu");
}
else if(id=="IZPIS")
{
ret = knjiga.ToString();
}
else if(id=="DELETE")
{
ret = knjiga.Delete(5);
}
return ret;
}
示例4: JSONData
public Book JSONData(string id,string naslov, string avtor, string gradivo, string leto, string jezik, string zalozba)
{
Book knjiga = new Book(naslov, avtor, leto, jezik, gradivo, zalozba);
string ret = "";
if (id == "DODAJ")
{
ret = knjiga.AddNewBook();
}
else if (id == "UREDI")
{
ret = knjiga.Update(naslov, avtor, leto, jezik, gradivo, zalozba);
}
else if (id == "IZPIS")
{
ret = knjiga.ToString();
}
else if (id == "DELETE")
{
ret = knjiga.Delete(5);
}
return knjiga;
}
示例5: When_displaying_a_book__should_show_the_book_title_as_a_number
public void When_displaying_a_book__should_show_the_book_title_as_a_number()
{
var book = new Book(BookTitle.BookOne);
Assert.AreEqual("1", book.ToString());
}
示例6: ShowBook
// Contravariance means only one method is needed to show all
// types of books.
static void ShowBook(Book b)
{
Console.WriteLine(b.ToString());
}
示例7: Print
private static void Print(Book s)
{
Console.WriteLine(s.ToString());
}