2using System.Collections.Generic;
5using System.Threading.Tasks;
6using static ConsoleApp1.Reader;
14 var lib = new Library();
16 Console.WriteLine("1 - Add Book \n2- write file \n3 - read file \n4 - print library");
17 switch (Console.ReadLine()) {
19 var book = new Book() {
20 name = GetString("Book name:"),
21 author = GetString("Author name: "),
22 pageCount = GetInt("Page count: ", x => x > 0, "that is not a valid positive int."),
23 dateAdded = GetDate("Date released in dd.mm.yyyy: ", _ => true, "That is not a valid date."),
24 isSpecialEdition = GetBool("Is special edition: ", "That is not a valid bool.")
26 if (book.isSpecialEdition) {
27 book.value = GetInt("Special edition value: ", x => x > 0, "that is not a valid positive int.");
32 foreach(var b in lib) {
37 lib.SerializeAll("../../../lib.xml");
40 lib.ReadXMLFrom("../../../lib.xml");
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list