The delegate keyword indicates that the following is essentially the signature of the function, so Refresh becomes kind of like a pointer to a function that takes no arguments. However, in order to assign something to the Refresh pointer, you must tell it the function that it points to. In this case, this is the Reset function. In addition, the Reset function should not accept any arguments.
In addition, the syntax is:
Refresh = Reset;
also valid and is just syntactic sugar for a more formal syntax:
Refresh = new NoArguments(Reset);
in both cases, you can execute the Reset function by calling Refresh:
Refresh();
Note, however, that if you execute Refresh() without assigning it, you can throw an exception. To prevent this, you need to check it for null:
if (Refresh != null) Refresh(); else {
source share