Results 1 to 2 of 2

Thread: How to Implement delegates in out .Net application

  1. #1
    Junior Member
    Join Date
    May 2007
    Answers
    1

    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


  2. #2
    Contributing Member
    Join Date
    May 2007
    Answers
    60

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact