Library tutorials & articles
Exploring Delegates
- Introduction
- An Example
- Running the example
- Assembly Code
Introduction
Delegates are a kind of type safe function pointers which are actually declared
as class derived from System.MulticastDelegate. There are few rules
how to write that class. First you must declare .ctor and Invoke methods, if
you like to have asynchronous callback involved there are two more methods just
for that case BeginInvoke and EndInvoke. Except for these two or four methods
nothing else should be declared and these declarations must be without implementation
(empty body). This is what it looks like: .method public hidebysig specialname rtspecialname
instance void .ctor(object 'object',
native int 'method') runtime managed
{
} // end of method WildCard::.ctor
.method public hidebysig virtual instance int32
Invoke() runtime managed
{
} // end of method WildCard::Invoke
Related articles
Related discussion
-
String was not recognized as a valid DateTime.
by royal ludhiana (19 replies)
-
save .csv with newline character
by James Crowley (1 replies)
-
Loop help needed
by mandy130 (3 replies)
-
ASP.NET Patterns every developer should know
by AndyGrant2005 (2 replies)
-
Create PDF Files on fly in C#
by Geeths (1 replies)
Related podcasts
-
Looking into the C# Crystal Ball with Charlie Calvert and Bill Wagner
One of the most exciting announcements from PDC was the news about C# 4.0 and Visual Studio 2010. With all the excitement and discussion throughout the event about these new developer tools, we reached out to two experts in the fields. Charlie Calvert and Bill Wagner sat down with Keith and Woody...
Events coming up
-
Dec
6
Developing AJAX Web Applications with Castle Monorail
London, United Kingdom
Monorail is the model-view-controller engine of the Castle Project, bringing many of the best ideas of Ruby on Rails to the .NET world. In this talk, David De Florinier and Gojko Adzic show how Monorail makes it easy to develop .NET based AJAX applications, and how to use the Castle Project to build Web 2.0 applications effectively. Come to this session if you are a .NET web developer. Everyone is welcome!
This thread is for discussions of Exploring Delegates.