What if Button1_Click is defined in a different assembly from the methods it's calling? What if I dont want to hard-code method names? What if I want to write a generic in-order traversal for my balanced binary tree? Delegates allow you to define a signature
for a function and have someone else provide you with the implementation. They're for enabling "loose coupling" of your application.
If the answer I provided is useful or informative please check the "answer" button.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
Contributor
3938 Points
3276 Posts
Re: Question About Delegates
Jan 02, 2009 11:01 AM|JeffreyABecker|LINK
What if Button1_Click is defined in a different assembly from the methods it's calling? What if I dont want to hard-code method names? What if I want to write a generic in-order traversal for my balanced binary tree? Delegates allow you to define a signature for a function and have someone else provide you with the implementation. They're for enabling "loose coupling" of your application.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.