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,28 +1,27 @@
using System;
using Spectre.Console.Cli;
namespace Spectre.Console.Testing
namespace Spectre.Console.Testing;
/// <summary>
/// A <see cref="ICommandInterceptor"/> that triggers a callback when invoked.
/// </summary>
public sealed class CallbackCommandInterceptor : ICommandInterceptor
{
private readonly Action<CommandContext, CommandSettings> _callback;
/// <summary>
/// A <see cref="ICommandInterceptor"/> that triggers a callback when invoked.
/// Initializes a new instance of the <see cref="CallbackCommandInterceptor"/> class.
/// </summary>
public sealed class CallbackCommandInterceptor : ICommandInterceptor
/// <param name="callback">The callback to call when the interceptor is invoked.</param>
public CallbackCommandInterceptor(Action<CommandContext, CommandSettings> callback)
{
private readonly Action<CommandContext, CommandSettings> _callback;
_callback = callback ?? throw new ArgumentNullException(nameof(callback));
}
/// <summary>
/// Initializes a new instance of the <see cref="CallbackCommandInterceptor"/> class.
/// </summary>
/// <param name="callback">The callback to call when the interceptor is invoked.</param>
public CallbackCommandInterceptor(Action<CommandContext, CommandSettings> callback)
{
_callback = callback ?? throw new ArgumentNullException(nameof(callback));
}
/// <inheritdoc/>
public void Intercept(CommandContext context, CommandSettings settings)
{
_callback(context, settings);
}
/// <inheritdoc/>
public void Intercept(CommandContext context, CommandSettings settings)
{
_callback(context, settings);
}
}