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
What are the benefits of normalization?
List out a number of the wants to setup a SQL Server failover cluster?
Can sub report data source be different from that of the parent report?
How do you handle datasets larger than 50 gb?
What are exact numeric data types in ms sql server?
How to drop existing views from a database in ms sql server?
Explain temporary table vs table variable by using cursor alternative?
What is difference between unique and primary key?
what happens on checkpoint? : Sql server database administration
What is difference between equi join and inner join?
Mention the uses of stored procedures.
Why we need sql server?
What is the new security features added in sql server 2014? : sql server security
What are the steps you must follow to hide sql server instances?
What is the process of normalization?