A delegate is a special kind of object that holds a reference to a method. Once a delegate is assigned a method, it behaves exactly like that method. It can have parameters and a return value. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object.
Read more…
The scope of a variable declaration determines its visibility to the rest of a program. Scopes can be member-level, class-level and nested, where an inner scope may re-declare the meaning of a variable from an outer scope.
When declared inside a member, the scope of the variable is the entire member after the variable declaration, including all nested code blocks. This means that the variable is available to use within the member but when control passes to another member, the variable is unavailable.
Read more…