As an example, you will prepare a simple application that allows a user to read a book by changing the pages. One should be able to move to the next page (if it exists) after pressing the N key, and go back to the previous page (if it exists) after pressing the P key. The content of the current page, together with the page number, should be shown in the console, as presented in the following screenshot:
Let's start with the declaration of the Page class, as shown in the following code:
public class Page { public string Content { get; set; } }
This class represents a single page and contains the Content property. You ...