What is a delegate, why should you use it and how do you call it ?
Answer / ajay vikram
A delegate is a reference type that refers to a Shared method of a type or to an instance method of an object. Delegate is like a function pointer in C and C++. Pointers are used to store the address of a thing. Delegate lets some other code call your function without needing to know where your function is actually located. All events in .NET actually use delegates in the background to wire up events. Events are really just a modified form of a delegate.
It should give you an idea of some different areas in which delegates may be appropriate:
• They enable callback functionality in multi-tier applications as demonstrated in the examples above. <o:p></o:p>
• The CacheItemRemoveCallback delegate can be used in ASP.NET to keep cached information up to date. When the cached information is removed for any reason, the associated callback is exercised and could contain a reload of the cached information. <o:p></o:p>
• Use delegates to facilitate asynchronous processing for methods that do not offer asynchronous behavior.
• Events use delegates so clients can give the application events to call when the event is fired. Exposing custom events within your applications requires the use of delegates.
| Is This Answer Correct ? | 0 Yes | 0 No |
Define thread? Explain about multithreading?
What are the 3 elements of delegation?
What is the use of static in c#?
What is distribute by in hive?
Give an example of a directcast.
How do you pass reference parameters in c#?
1)what is timestamp in C# (anilringole@gmail.com)
Is it possible to have a static indexer in c#? Allowed in c#.
How to find out that the code is written as managed or un-managed code?
What are interfaces in c#?
What is the namespace for datatable in c#?
Define strong name in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)