Advertisement
Fhernd

SinActionT.cs

Jul 26th, 2014
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement