Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created November 1, 2016 18:04
Show Gist options
  • Save scionwest/5a8e3fa0d7cab2240d9786d0b82288bb to your computer and use it in GitHub Desktop.
Save scionwest/5a8e3fa0d7cab2240d9786d0b82288bb to your computer and use it in GitHub Desktop.
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
try
{
throw new Exception();
}
finally
{
Console.WriteLine("A");
}
}
catch (Exception) when (ShouldProcessCondition())
{
Console.WriteLine("B");
}
Console.ReadKey();
}
static bool ShouldProcessCondition()
{
Console.WriteLine("C");
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment