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 is a derived table?
what is blocking? : Sql server database administration
What is store procedure? When do you use?
What is advantage data architect?
Can we add an identity column to decimal datatype?
Do you know spatial data types - geometry and geography in sql server 2008?
code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that
Why variables called the most powerful component of ssis?
What is 'Join' and explain its various types.
what are defaults? Is there a column to which a default can't be bound? : Sql server database administration
What is constraints and its types?
What are the different index configurations a table can have?
Difference between Sql server reporting services and Crystal reports?
how you can deploy an ssrs report?
What are the underflow and overflow behaviors on float literals?