Archives: November 2010

MultiCast Delegate Beispiel

Published on: November 15, 2010
Categories: C# C++ und C
Tags: No Tags
Comments: No Comments

MultiCast Delegate Beispiel
class Program
{
public delegate void Operation(int wert1, int wert2);
static void Main(string[] args)
{
klasse x = new klasse();
Operation[] proz = new Operation[2];
proz[0] = new Operation(x.Methode1);
proz[1] = new Operation(x.Methode2);
Operation array = (Operation)Delegate.Combine(proz);
array(1, 2);
Console.ReadLine();
}
class klasse
{
public void Methode1(int x, int y)
{
Console.WriteLine(“1.{0}{1}”,x,y);
}
public void Methode2(int x, int y)
{
Console.WriteLine(“2.{0}{1}”, x, y);
}
}

}

page 1 of 1

 
Welcome , today is Thursday, April 24, 2014