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
Exploring Delegates
- Introduction
- An Example
- Running the example
- Assembly Code
Introduction
You might also like...
C# books
-
Beginning ASP.NET 2.0 E-Commerce in C# 2005: From Novice to Professional
You will learn how to build a complete e-commerce web site, following the entire design and build process. The website will be constructed following industry best practices in a modular manner&emdash;with a new module introduced and completed in each...
C# forum discussion
-
USB Drive Activity Logger!
by coque0912 (7 replies)
-
Exporting data from a repeater to an Excel sheet
by TomBlack (28 replies)
-
Calculate Date of Birth from Age
by k.prashanth (7 replies)
-
Windows Service, getting outOf memory exception
by programmerdude2341 (3 replies)
-
How to Make Default Button?
by puspitaonlinebooks (24 replies)
C# podcasts
-
.NET Rocks: Stories from CodeMash!
Published 8 years ago, running time 0h56m
While at CodeMash, Carl and Richard collected some great stories. First up is Evan Huack, who digs into cudafy, a library on codeplex that allows you to run C# code (any IL code actually) on your GPU. The second story is about Jessie Shternshus and her company The Improv Effect. Jessie talks abou.
C# jobs
-
.NET, C#, MVC Senior Software Developer
Frontline Technologies, Inc. in Exton, United States
-
C#, JQuery, KnockoutJs. Nhibernate. Unique 3-6 month opportunity in Kitesurfing/Windsurfing heaven
RWI in Cabarete, Dominican Republic
$12,000-12,000 USD per year (Contract) -
C# / .NET Programmer
Mews Systems in Prague, Czech Republic
-
Experienced C# Developer
Zenco Systems Ltd in Rugby, United Kingdom
Annual Bonus, Annual Salary Review, Perfomance Related Bonus
Comments