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 delegate void MostrarMensaje(string mensaje);
  7.    
  8.     public class SinActionT
  9.     {
  10.         public static void Main()
  11.         {
  12.             MostrarMensaje mm;
  13.            
  14.             if (Environment.GetCommandLineArgs().Length > 1)
  15.             {
  16.                 mm = MostrarEnVentana;
  17.             }
  18.             else
  19.             {
  20.                 mm = Console.WriteLine;
  21.             }
  22.            
  23.             mm("Blog xCSw");
  24.         }
  25.        
  26.         private static void MostrarEnVentana(string mensaje)
  27.         {
  28.             MessageBox.Show(mensaje);
  29.         }
  30.     }
  31. }