- Create a class with methods.
E.g.: class test
{
public void print ()
{
}
}
- Create a delegate.
Syntax:
public delegate <return_type_of_method> <delegate_name >();
E.g.: public delegate void xyz ();
- Create an object for delegate with the address of class method.
E.g.: test t =new test;
xyz x = new xyz (t.print);
- Invoke or class the delegate.
E.g.: x ();
Steps to create a delegate:
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment