MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE

Answer Posted / lince thomas

delegate void myDelegate(string s);//this is a delagate
//two functions below.

private void SayHello(string h)
{
MessageBox.Show("Hello" + h);
}

private void SayHai(string h)
{
MessageBox.Show("Hai" + h);
}

private void button1_Click(object sender, EventArgs e)
{
Delegate del;
myDelegate objDel = new myDelegate(SayHello);
myDelegate objDel1 = new myDelegate(SayHai);
del = MulticastDelegate.Combine(objDel, objDel1);
del.DynamicInvoke("Peter");
}

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is log shipping? Can we do logshipping with SQL Server 7.0 ?

580


If you lose rights to your sql server instance what are the options to connect to sql server instance? : sql server security

541


Can we use trigger new in before insert?

521


What do you understand by triggers and mention the different types of it?

490


What is for xml in sql server?

546






What are the difference between primary keys and foreign keys?

546


Does a sql server 2005 select statement require a from?

589


What is an identity?

574


wat wil hapn if we give the both read and deny read permission to user?

1659


What should be the fill factor for indexes created on tables? : sql server database administration

633


Explain “@@rowcount” and “@@error” in sql server?

541


What do you understand by a stored procedure?

614


What is open database communication (odbc)?

575


What are cascading parameters in ssrs reports?

176


What do you mean by acid?

582