Struct e delegate

lunedì 26 marzo 2007 - 11.40

paolo973 Profilo | Senior Member

Ho una struct, miastruct, desidero inserire un campo che mi consenta la chiamata ad un delegate.

Come Fare ?


public struct miastruct
{
public int campo1;
public int campo2;
public int campo3;
public miastruct(int uno, int due, int tre)
{
campo1=uno;
campo2=due;
campo3=tre;
}
}

public delegate void miodelegate(string value);

class Program
{
....
....
static public void metodo1(string value)
{
Console.Write("valore " + value);
}

miodelegatedelegato= new miodelegate(metodo1);

....
}
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5