Created
May 31, 2014 19:55
-
-
Save Fhernd/0c1ea3a17049dd06701a to your computer and use it in GitHub Desktop.
Demostración del delegado incorporado Action<T> en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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