Created
May 31, 2014 15:20
-
-
Save Fhernd/5cccfcbbf578c678390d to your computer and use it in GitHub Desktop.
Demostración de la compatibilidad de delegados 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; | |
namespace Articulos.Cap04 | |
{ | |
public delegate void Delegado1(); | |
public delegate void Delegado2(); | |
public class Aplicacion | |
{ | |
public static void Main() | |
{ | |
Delegado1 d1 = Metodo; | |
// Generará el error CS0029: | |
// Cannot implicitly convert type...: | |
Delegado2 d2 = d1; | |
} | |
public static void Metodo() | |
{ | |
Console.WriteLine("Metodo"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment