fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Test t = new Test();
  8. var AnonymousMethod = t.OuterMethod();
  9. AnonymousMethod("passedValue");
  10. }
  11. public delegate void SampleDelegate(string InputText);
  12.  
  13. public SampleDelegate OuterMethod()
  14. {
  15. string outerValue="outerValue";
  16. return (x => {
  17. Console.WriteLine(x);
  18. Console.WriteLine(outerValue);
  19. });
  20.  
  21. }
  22. }
Success #stdin #stdout 0.02s 33744KB
stdin
Standard input is empty
stdout
passedValue
outerValue