Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var input = "krabas";

            /*
             * Display display = new Display(ConsolePrint);
             * display.Print(input);
             */

            /*
             * Display display = new Display(ConsolePrint);
             * display.FormattedPrint(FirstLetterToUpper, input);
             */
            DisplayEventArgs  arguments     = new DisplayEventArgs(input);
            DisplayWithEvents displayEvents = new DisplayWithEvents();

            displayEvents.OutputDisplay += ConsolePrint;
            displayEvents.OutputDisplay += DebugPrint;

            displayEvents.OnOutputDisplay(arguments);


            SettingsConfig();
            Menu();
            Console.ReadLine();
        }
 public void OnOutputDisplay(DisplayEventArgs e)
 {
     if (OutputDisplay != null)
     {
         OutputDisplay(this, e);
     }
 }
Exemplo n.º 3
0
 public static void DebugPrint(object sender, DisplayEventArgs e)
 {
     Debug.WriteLine($"Hello {e.Input}!");
 }
Exemplo n.º 4
0
 public static void ConsolePrint(object sender, DisplayEventArgs e)
 {
     Console.WriteLine($"Hello {e.Input}!");
 }