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

Is sql server is free?

0 Answers  


What is the guest user account in sql server? What login is it mapped to it? : sql server security

0 Answers  


Explain linked server in sql?

0 Answers  


Does sql server use java?

0 Answers  


What is RAID? What are the different types of RAID configurations?

0 Answers   Flextronics,






What is the cartesian product of the table?

0 Answers  


Does table partitioning improve performance?

0 Answers  


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

0 Answers  


What is user defined stored procedures?

0 Answers  


Difference between uniqe index and uniqe constraint?

0 Answers  


What is @@Identity in sql?

1 Answers   Cap Gemini,


Explain about sql server login?

0 Answers  


Categories