Skip to content

Instantly share code, notes, and snippets.

@mletterle
Created October 26, 2010 02:25
Show Gist options
  • Save mletterle/646212 to your computer and use it in GitHub Desktop.
Save mletterle/646212 to your computer and use it in GitHub Desktop.
namespace Test
{
class Test
{
public delegate void MyDelegate();
public void TestMethod()
{
TestMethod2( delegate()
{
goto outLabel;
outLabel:
System.Environment.Exit(0);
});
}
public static void TestMethod2(MyDelegate md)
{
md.Invoke();
}
}
}
@bcr
Copy link

bcr commented Oct 26, 2010

C:\Users\Blake\Temp>type test.cs
namespace Test
{
  class Test
  {
    public delegate void MyDelegate();
    public void TestMethod()
    {
      TestMethod2( delegate()
        {
          goto outLabel;
           outLabel:
               System.Environment.Exit(0);
            });
    }
      public static void TestMethod2(MyDelegate md)
      {
        md.Invoke();
      }
    }
  }
C:\Users\Blake\Temp>csc /target:library test.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.


C:\Users\Blake\Temp>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment