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 stored by the model?
How to create “dependant” parameter “make, model, year”
What is partitioned view?
What is instead of trigger sql server?
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
How to use subqueries with the in operators in ms sql server?
How to choose all records from the table?
Describe how to use linked server?
If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?
What are entities and relationships?
Determine when an index is appropriate?
Write a sql query to delete duplicate records from a table called table1
Where are sql server user names and passwords stored in sql server?
How to change parameter value inside the report?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?