Пример #1
0
        static void Main(string[] args)
        {
            Book.Notes name = new Book.Notes();
            Console.Write(new string('-', 120));
            string headline = "Заметки в тексте:";

            headline = headline.PadLeft(70);
            Console.WriteLine(headline.ToUpper());
            Console.Write(new string('-', 120) + "\n");
            Console.WriteLine("Выбранный Вами текст:\n\n{0}", name.text);
            Console.Write(new string('-', 120));
Again:
            Console.Write("\nВведите пожалуйста слово возле которого стоит поставить заметку: ");
            Console.ForegroundColor = ConsoleColor.Yellow;
            string find = Console.ReadLine();

            Console.ForegroundColor = ConsoleColor.Gray;
            Console.Write(new string('-', 120));
            if (string.IsNullOrEmpty(find))
            {
                Console.WriteLine("Вы не ввели слово! Повторите пожалуйста эту операцию заново!");
                Console.Write(new string('-', 120));
                goto Again;
            }
            Console.WriteLine("Вывод в тексте заданного слова. Напишите пожалуйста рядом свою заметку!\n");
            Console.WriteLine(new string('-', 120));
            name.FindNext(find);
            Console.WriteLine("\n");
            Console.Write(new string('*', 120));
            Console.Write(new string('*', 120));
            Console.Write(new string('-', 120));
            goto Again;
        }
Пример #2
0
        static void Main(string[] args)
        {
            Book book = new Book();

            book.FindNext("Мужчина приходит к врачу, жалуется на депрессию");

            Book.Notes notes = new Book.Notes();
            notes.Method();

            Console.ReadKey();
        }