Delegates Delegates are similar to C++'s function pointers, as it says on the tin a pointer to a function. The beauty of delegates and function pointers is that you can throw it around in different classes without that class having knowledge of the object to which the function belongs. Here's a simple example: declare your delegate in some class. public delegate void DelegateFunc();// you must have a func with the same signature now create a function in another class with same return type and same parameters. class DelegateClass { public static void TheRealDelegateFunc() { } } now call the delegate from the first class public delegate void DelegateFunc();// you must have a func with the same signature static void Main(string[] args) { DelegateFunc df = new DelegateFunc(DelegateClass.TheRealDelegateFunc); df.Invoke(); } Notice the Invoke() function, this is required to r...
Layman explanations of Software coding and configuration techniques. With example code where possible.