Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created May 31, 2014 15:20
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/5cccfcbbf578c678390d to your computer and use it in GitHub Desktop.
Save Fhernd/5cccfcbbf578c678390d to your computer and use it in GitHub Desktop.
Demostración de la compatibilidad de delegados en C#.
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