Other popular object oriented languages like Java and Smalltalk do not have the concept of delegates. The delegate is new to C# and it derives its roots from C++ and J++. I hope that this article has helped clear the confusion commonly surrounding delegates for programmers who are just starting out with C# as their first object oriented language.
If you are using the Visual Studio IDE for your C# GUI development, attaching your delegate methods to the events generated by GUI controls (like a mouse click on a button) can be done without writing any code. Still, it is better to know what is going on under the hood just in case you might need it some time.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |