Is it possible to declare a method within another method in C#?
For example like that:
void OuterMethod() { int anything = 1; InnerMethod();
The delegate keyword does just that.
delegate
void OuterMethod() { var InnerMethod = delegate() { int PlitschPlatsch = 2; }; int anything = 1; InnerMethod(); }
Don't forget that, per scoping, the PlitschPlatsch variable won't be accessible outside InnerMethod.
PlitschPlatsch