MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE

Answers were Sorted based on User's Feedback



MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE..

Answer / guest

delegates used to invoke one function. Multicasst delegate
is used to invoke mmore than one function
Say for example
This is our delegate
delegate void myDelegate (string s);

Weh ve two functions like
publc void sayHello(String Name)
{
//implementation goes here
}
public void sayHai(String Name)
{
//implementation goes here
}

If we want to invoke both of these functions
use like


myDelegate md= new myDelegate(sayHello);
md+=new myDelegate(sayHai);

Is This Answer Correct ?    33 Yes 4 No

MULTICAST DELEGATES IN C#.NET WITH REAL TIME EXAMPLE..

Answer / 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

More SQL Server Interview Questions

What is Query Execution Plan? How does it help optimize or tune a database driven application?

2 Answers   Accenture, Polaris,


What is the default isolation level of the sql server database?

1 Answers   Ness Technologies,


Explain some DBCC commands?

6 Answers  


How do you find the error, how can you know the number of rows effected by last SQL statement?

1 Answers  


How to connect of datebase with sql express.?

0 Answers   MCN Solutions,






Explain sql server service broker?

0 Answers  


What is data block and how to define data block size?

0 Answers  


What is the purpose of object explorer and its features? : sql server management studio

0 Answers  


create index myindex on mytable(mycolumn) what type of index will get created after executing the above statement? : Sql server database administration

0 Answers  


which table keeps the locking information? : Sql server administration

0 Answers  


What is a primary index?

0 Answers  


What is an expensive query?

0 Answers  


Categories