/// <summary>
        /// Display in console books in file.
        /// </summary>
        /// <param name="bookList">List of books.</param>

        public static void DisplayBook(IList <Book> bookList)
        {
            ServiceBookLogger.Info("Start display the library on the console");
            if (bookList != null)
            {
                foreach (Book book in bookList)
                {
                    Console.WriteLine(book.ToString());
                }
            }

            Console.WriteLine(new string('-', 10));
            ServiceBookLogger.Info("Finish display the library on the console");
        }
        /// <summary>
        /// Remove book from file.
        /// </summary>
        /// <param name="removeBook">Book.</param>

        public void RemoveBook(Book removeBook)
        {
            try
            {
                ServiceBookLogger.Info("Start of block processing TYR in which remove book");
                ListService.RemoveBook(removeBook);
                ServiceBookLogger.Info("End of block processing TYR in which remove book");
            }
            catch (RemoveBookException ex)
            {
                Console.WriteLine(ex.Message);
                ServiceBookLogger.Info(ex.Message);
                ServiceBookLogger.Error(ex.StackTrace);
            }
        }
        /// <summary>
        /// Add book in file.
        /// </summary>
        /// <param name="addBook">Book</param>

        public void AddBook(Book addBook)
        {
            try
            {
                ServiceBookLogger.Info("Start of block processing TYR in which adding books");
                ListService.AddBook(addBook);
                ServiceBookLogger.Info("End of block processing TYR in which adding books");
            }
            catch (AddBookException ex)
            {
                Console.WriteLine(ex.Message);
                ServiceBookLogger.Info(ex.Message);
                ServiceBookLogger.Error(ex.StackTrace);
            }
        }
        static void Main(string[] args)
        {
            OperationWithFile operationWithFile = new OperationWithFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["address"]));
            BookListService   bookListService   = new BookListService(operationWithFile);

            Book book1 = new Book("Есенин", "Первая книга", "Москва", 1955, 150);
            Book book2 = new Book("Пушкин", "Вторая книга", "Российская Империя", 1955, 150);


            BookUiHelpFunction bookUiHelpFunction = new BookUiHelpFunction(operationWithFile, bookListService);

            bookUiHelpFunction.AddBook(book1);
            bookUiHelpFunction.AddBook(book1);
            bookUiHelpFunction.RemoveBook(book2);
            bookUiHelpFunction.AddBook(book2);


            List <Book> resultFind = (List <Book>)bookListService.FindByTag(book => book.NumberOfPages == 150);

            ServiceBookLogger.Info("Find list book where number of page = 189");
            DisplayBook(resultFind);

            Console.ReadKey();
        }