Delegates are very similar to 'pointers to functions' in C and C++
First we create a delegate, then we can assign any function that has a similar prototype of the one which we have specified with the delegate.
Declaration:
public delegate int Dlg(int x, int y); //where Dlg is the name of Delegate
http://www.cegonsoft.com/jobassistanceprogram.php
Create Object:
when we need to create a 'Delegate object' (i.e. a pointer to a function which has a specified prototype)
Dlg d1=new Dlg(function_name); //if the class is in some other class use 'class_name.function_name'
function_name->has to be the name of a function which receives two integers as arguments and return an integer
Invoking function:
int res=d1(20, 20);
http://www.aboutcegonsoft.com/ - Cegonsoft
Answered Jul 13, 2011
Edited Jul 13, 2011