.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

what is DELEGATES in .NET?

Posted By: RASHMI KUSHWAHA     Posted Date: July 11, 2011    Points:5   Category :.NET Framework
what is DELEGATES in .NET? Please explain

Responses
Author: Ravi Ranjan Kumar             
Posted Date: July 11, 2011     Points: 20   

A delegate object is a special type of object that contains the details of a method rather than data delegates in .net are used for two purposes
a) Callback
b) Event Handling

The Dictionary meaning of Delagates is "A person acting for another person". but in .net its a really means a method acting for another method as pointed out earlier in my previous answer.
hence A delegate is a form of type-safe function pointer used by the .NET Framework. Delegates specify a method to call and optionally an object to call the method on. They are used, among other things, to implement callbacks and event listeners. It encapsulates a reference of a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked.

For more details about Delegate Google is the best bet for you..
as I got given article on MSDN
http://msdn.microsoft.com/en-us/magazine/cc301810.aspx


Thanks & Regards
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com
Author: Michael Caine             
Posted Date: July 12, 2011     Points: 20   

Delegate is like function pointer in c. Using this we can call a function in any class without using the class name or creating object for that class. In addition, we can add two delegates to a single delegate so that it will act as a combination of two functions.


Author: Narayanan             
Posted Date: July 12, 2011     Points: 20   

Hi,
-- Similar to function Pointer in C or C++.
-- Encapsulate a reference to a method inside a Delegate Object
-- passed Code which can call the Referenced method without having to know at Compiler time which method will be invoked.


Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: kamlesh             
Posted Date: July 12, 2011     Points: 20   

http://msdn.microsoft.com/en-us/library/ms173171%28v=vs.80%29.aspx
http://msdn.microsoft.com/en-us/library/aa288459%28v=vs.71%29.aspx
http://www.akadia.com/services/dotnet_delegates_and_events.html
http://www.c-sharpcorner.com/UploadFile/Ashush/Delegates02152008155757PM/Delegates.aspx

Thanks And Regards.
Kamlesh Nikam
Author: gsuryaprasath             
Posted Date: July 14, 2011     Points: 20   

A [URL=http://www.cegonsoft.com/jobassistanceprogram.php]delegate[/URL] in C# is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked.

More Details : [URL=http://www.aboutcegonsoft.com/]Delegates[/URL]



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend