-
Junior Member
How to Implement delegates in out .Net application
Hi
Can anyone tell me How to Implement delegates in out .Net application
Can you please give me sample example
-
Contributing Member
Re: How to Implement delegates in out .Net application
Delegate is nothing but a function pointer in c++. Microsoft implemented deleagtes in events and threads.
Events: Event source doesn't know who will handle the event and event handler doesn't know who raised the event the delegate is act like a interface between event source and event handler here event handler signature and delegate signature is same and event type is delegate type.
namespace n1{
class class1{
public void delegate d1();
public event d1 e1;
public void Event_Handler()
{
//code
}
public static void main(){
//bind the event to event handler using delegete
this.e1 +=new d1(this.Event_Handler);
e1();
}
}
}
Last edited by hari.nattuva; 06-13-2007 at 08:41 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules