Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created May 31, 2014 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/0c1ea3a17049dd06701a to your computer and use it in GitHub Desktop.
Save Fhernd/0c1ea3a17049dd06701a to your computer and use it in GitHub Desktop.
Demostración del delegado incorporado Action<T> en C#.
using System;
using System.Windows.Forms;
namespace Articulos.Cap03
{
public class ConActionT
{
public static void Main()
{
Action<string> mm;
if (Environment.GetCommandLineArgs().Length > 1)
{
mm = MostrarEnVentana;
}
else
{
mm = Console.WriteLine;
}
mm("Blog xCSw");
}
private static void MostrarEnVentana(string mensaje)
{
MessageBox.Show(mensaje);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment