Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4. namespace Articulos.Cap03
  5. {    
  6.     public class ConActionT
  7.     {
  8.         public static void Main()
  9.         {
  10.             Action<string> mm;
  11.            
  12.             if (Environment.GetCommandLineArgs().Length > 1)
  13.             {
  14.                 mm = MostrarEnVentana;
  15.             }
  16.             else
  17.             {
  18.                 mm = Console.WriteLine;
  19.             }
  20.            
  21.             mm("Blog xCSw");
  22.         }
  23.        
  24.         private static void MostrarEnVentana(string mensaje)
  25.         {
  26.             MessageBox.Show(mensaje);
  27.         }
  28.     }
  29. }