Use file scoped namespace declarations

This commit is contained in:
Patrik Svensson
2021-12-21 11:06:46 +01:00
committed by Phil Scott
parent 1dbaf50935
commit ec1188b837
607 changed files with 28739 additions and 29245 deletions

View File

@@ -1,30 +1,29 @@
using System;
namespace Spectre.Console.Examples
namespace Spectre.Console.Examples;
public static class ExceptionGenerator
{
public static class ExceptionGenerator
public static Exception GenerateException()
{
public static Exception GenerateException()
try
{
try
{
SomeOperation();
throw new InvalidOperationException();
}
catch (Exception ex)
{
return ex;
}
SomeOperation();
throw new InvalidOperationException();
}
private static void SomeOperation()
catch (Exception ex)
{
SomeOperationGoingWrong();
}
private static void SomeOperationGoingWrong()
{
throw new InvalidOperationException("Something went very wrong!");
return ex;
}
}
private static void SomeOperation()
{
SomeOperationGoingWrong();
}
private static void SomeOperationGoingWrong()
{
throw new InvalidOperationException("Something went very wrong!");
}
}