mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-10-31 09:09:25 +08:00 
			
		
		
		
	Use file scoped namespace declarations
This commit is contained in:
		 Patrik Svensson
					Patrik Svensson
				
			
				
					committed by
					
						 Phil Scott
						Phil Scott
					
				
			
			
				
	
			
			
			 Phil Scott
						Phil Scott
					
				
			
						parent
						
							1dbaf50935
						
					
				
				
					commit
					ec1188b837
				
			| @@ -30,6 +30,9 @@ trim_trailing_whitespace = false | ||||
| end_of_line = lf | ||||
|  | ||||
| [*.cs] | ||||
| # Prefer file scoped namespace declarations | ||||
| csharp_style_namespace_declarations = file_scoped:warning | ||||
|  | ||||
| # Sort using and Import directives with System.* appearing first | ||||
| dotnet_sort_system_directives_first = true | ||||
| dotnet_separate_import_directive_groups = false | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using System.ComponentModel; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static partial class Program | ||||
| { | ||||
|     public static partial class Program | ||||
|     { | ||||
|     public sealed class BarSettings : CommandSettings | ||||
|     { | ||||
|         [CommandOption("--count")] | ||||
| @@ -12,5 +12,4 @@ namespace Spectre.Console.Examples | ||||
|         [DefaultValue(1)] | ||||
|         public int Count { get; set; } | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static partial class Program | ||||
| { | ||||
|     public static partial class Program | ||||
|     { | ||||
|     public static int Main(string[] args) | ||||
|     { | ||||
|         var app = new CommandApp(); | ||||
| @@ -34,5 +34,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,11 +2,11 @@ using System.ComponentModel; | ||||
| using Demo.Utilities; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo.Commands | ||||
| namespace Demo.Commands; | ||||
|  | ||||
| [Description("Add a NuGet package reference to the project.")] | ||||
| public sealed class AddPackageCommand : Command<AddPackageCommand.Settings> | ||||
| { | ||||
|     [Description("Add a NuGet package reference to the project.")] | ||||
|     public sealed class AddPackageCommand : Command<AddPackageCommand.Settings> | ||||
|     { | ||||
|     public sealed class Settings : AddSettings | ||||
|     { | ||||
|         [CommandArgument(0, "<PACKAGENAME>")] | ||||
| @@ -43,5 +43,4 @@ namespace Demo.Commands | ||||
|         SettingsDumper.Dump(settings); | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System.ComponentModel; | ||||
| using Demo.Utilities; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo.Commands | ||||
| namespace Demo.Commands; | ||||
|  | ||||
| public sealed class AddReferenceCommand : Command<AddReferenceCommand.Settings> | ||||
| { | ||||
|     public sealed class AddReferenceCommand : Command<AddReferenceCommand.Settings> | ||||
|     { | ||||
|     public sealed class Settings : AddSettings | ||||
|     { | ||||
|         [CommandArgument(0, "<PROJECTPATH>")] | ||||
| @@ -26,5 +26,4 @@ namespace Demo.Commands | ||||
|         SettingsDumper.Dump(settings); | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,12 +1,11 @@ | ||||
| using System.ComponentModel; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo.Commands | ||||
| namespace Demo.Commands; | ||||
|  | ||||
| public abstract class AddSettings : CommandSettings | ||||
| { | ||||
|     public abstract class AddSettings : CommandSettings | ||||
|     { | ||||
|     [CommandArgument(0, "<PROJECT>")] | ||||
|     [Description("The project file to operate on. If a file is not specified, the command will search the current directory for one.")] | ||||
|     public string Project { get; set; } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,11 +2,11 @@ using System.ComponentModel; | ||||
| using Demo.Utilities; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo.Commands | ||||
| namespace Demo.Commands; | ||||
|  | ||||
| [Description("Build and run a .NET project output.")] | ||||
| public sealed class RunCommand : Command<RunCommand.Settings> | ||||
| { | ||||
|     [Description("Build and run a .NET project output.")] | ||||
|     public sealed class RunCommand : Command<RunCommand.Settings> | ||||
|     { | ||||
|     public sealed class Settings : CommandSettings | ||||
|     { | ||||
|         [CommandOption("-c|--configuration <CONFIGURATION>")] | ||||
| @@ -66,5 +66,4 @@ namespace Demo.Commands | ||||
|         SettingsDumper.Dump(settings); | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -3,11 +3,11 @@ using System.ComponentModel; | ||||
| using Demo.Utilities; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo.Commands | ||||
| namespace Demo.Commands; | ||||
|  | ||||
| [Description("Launches a web server in the current working directory and serves all files in it.")] | ||||
| public sealed class ServeCommand : Command<ServeCommand.Settings> | ||||
| { | ||||
|     [Description("Launches a web server in the current working directory and serves all files in it.")] | ||||
|     public sealed class ServeCommand : Command<ServeCommand.Settings> | ||||
|     { | ||||
|     public sealed class Settings : CommandSettings | ||||
|     { | ||||
|         [CommandOption("-p|--port <PORT>")] | ||||
| @@ -37,5 +37,4 @@ namespace Demo.Commands | ||||
|         SettingsDumper.Dump(settings); | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using Demo.Commands; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo | ||||
| namespace Demo; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static int Main(string[] args) | ||||
|     { | ||||
|         var app = new CommandApp(); | ||||
| @@ -33,5 +33,4 @@ namespace Demo | ||||
|  | ||||
|         return app.Run(args); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using Spectre.Console; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Demo.Utilities | ||||
| namespace Demo.Utilities; | ||||
|  | ||||
| public static class SettingsDumper | ||||
| { | ||||
|     public static class SettingsDumper | ||||
|     { | ||||
|     public static void Dump(CommandSettings settings) | ||||
|     { | ||||
|         var table = new Table().RoundedBorder(); | ||||
| @@ -25,5 +25,4 @@ namespace Demo.Utilities | ||||
|  | ||||
|         AnsiConsole.Write(table); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -3,19 +3,19 @@ using System.Collections.Generic; | ||||
| using System.ComponentModel; | ||||
| using System.Globalization; | ||||
|  | ||||
| namespace Demo | ||||
| namespace Demo; | ||||
|  | ||||
| public enum Verbosity | ||||
| { | ||||
|     public enum Verbosity | ||||
|     { | ||||
|     Quiet, | ||||
|     Minimal, | ||||
|     Normal, | ||||
|     Detailed, | ||||
|     Diagnostic | ||||
|     } | ||||
| } | ||||
|  | ||||
|     public sealed class VerbosityConverter : TypeConverter | ||||
|     { | ||||
| public sealed class VerbosityConverter : TypeConverter | ||||
| { | ||||
|     private readonly Dictionary<string, Verbosity> _lookup; | ||||
|  | ||||
|     public VerbosityConverter() | ||||
| @@ -50,5 +50,4 @@ namespace Demo | ||||
|         } | ||||
|         throw new NotSupportedException("Can't convert value to verbosity."); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using System; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class MyCommand : Command | ||||
| { | ||||
|     public sealed class MyCommand : Command | ||||
|     { | ||||
|     public override int Execute(CommandContext context) | ||||
|     { | ||||
|         if (!(context.Data is int data)) | ||||
| @@ -16,5 +16,4 @@ namespace Spectre.Console.Examples | ||||
|         AnsiConsole.WriteLine("Value = {0}", data); | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,16 +1,16 @@ | ||||
| using System.Linq; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static int Main(string[] args) | ||||
|     { | ||||
|         var app = new CommandApp(); | ||||
|         app.Configure(config => | ||||
|         { | ||||
|                 foreach(var index in Enumerable.Range(1, 10)) | ||||
|             foreach (var index in Enumerable.Range(1, 10)) | ||||
|             { | ||||
|                 config.AddCommand<MyCommand>($"c{index}") | ||||
|                     .WithDescription($"Prints the number {index}") | ||||
| @@ -20,5 +20,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         return app.Run(args); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using System.ComponentModel; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class DefaultCommand : Command<DefaultCommand.Settings> | ||||
| { | ||||
|     public sealed class DefaultCommand : Command<DefaultCommand.Settings> | ||||
|     { | ||||
|     private readonly IGreeter _greeter; | ||||
|  | ||||
|     public sealed class Settings : CommandSettings | ||||
| @@ -26,5 +26,4 @@ namespace Spectre.Console.Examples | ||||
|         _greeter.Greet(settings.Name); | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,15 +1,14 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| { | ||||
|     public interface IGreeter | ||||
|     { | ||||
|         void Greet(string name); | ||||
|     } | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
|     public sealed class HelloWorldGreeter : IGreeter | ||||
|     { | ||||
| public interface IGreeter | ||||
| { | ||||
|     void Greet(string name); | ||||
| } | ||||
|  | ||||
| public sealed class HelloWorldGreeter : IGreeter | ||||
| { | ||||
|     public void Greet(string name) | ||||
|     { | ||||
|         AnsiConsole.WriteLine($"Hello {name}!"); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class TypeRegistrar : ITypeRegistrar | ||||
| { | ||||
|     public sealed class TypeRegistrar : ITypeRegistrar | ||||
|     { | ||||
|     private readonly IServiceCollection _builder; | ||||
|  | ||||
|     public TypeRegistrar(IServiceCollection builder) | ||||
| @@ -37,5 +37,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         _builder.AddSingleton(service, (provider) => func()); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class TypeResolver : ITypeResolver, IDisposable | ||||
| { | ||||
|     public sealed class TypeResolver : ITypeResolver, IDisposable | ||||
|     { | ||||
|     private readonly IServiceProvider _provider; | ||||
|  | ||||
|     public TypeResolver(IServiceProvider provider) | ||||
| @@ -30,5 +30,4 @@ namespace Spectre.Console.Examples | ||||
|             disposable.Dispose(); | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public class Program | ||||
| { | ||||
|     public class Program | ||||
|     { | ||||
|     public static int Main(string[] args) | ||||
|     { | ||||
|         // Create a type registrar and register any dependencies. | ||||
| @@ -18,5 +18,4 @@ namespace Spectre.Console.Examples | ||||
|         var app = new CommandApp<DefaultCommand>(registrar); | ||||
|         return app.Run(args); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public class HelloCommand : Command<HelloCommand.Settings> | ||||
| { | ||||
|     public class HelloCommand : Command<HelloCommand.Settings> | ||||
|     { | ||||
|     private ILogger<HelloCommand> _logger; | ||||
|     private IAnsiConsole _console; | ||||
|  | ||||
| @@ -30,5 +30,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         return 0; | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -5,10 +5,10 @@ using System.Globalization; | ||||
| using Serilog.Events; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public class LogCommandSettings : CommandSettings | ||||
| { | ||||
|     public class LogCommandSettings : CommandSettings | ||||
|     { | ||||
|     [CommandOption("--logFile")] | ||||
|     [Description("Path and file name for logging")] | ||||
|     public string LogFile { get; set; } | ||||
| @@ -18,10 +18,10 @@ namespace Spectre.Console.Examples | ||||
|     [TypeConverter(typeof(VerbosityConverter))] | ||||
|     [DefaultValue(LogEventLevel.Information)] | ||||
|     public LogEventLevel LogLevel { get; set; } | ||||
|     } | ||||
| } | ||||
|  | ||||
|     public sealed class VerbosityConverter : TypeConverter | ||||
|     { | ||||
| public sealed class VerbosityConverter : TypeConverter | ||||
| { | ||||
|     private readonly Dictionary<string, LogEventLevel> _lookup; | ||||
|  | ||||
|     public VerbosityConverter() | ||||
| @@ -52,5 +52,4 @@ namespace Spectre.Console.Examples | ||||
|         } | ||||
|         throw new NotSupportedException("Can't convert value to verbosity."); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +1,10 @@ | ||||
| using Serilog.Core; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public class LogInterceptor : ICommandInterceptor | ||||
| { | ||||
|     public class LogInterceptor : ICommandInterceptor | ||||
|     { | ||||
|     public static readonly LoggingLevelSwitch LogLevel = new(); | ||||
|  | ||||
|     public void Intercept(CommandContext context, CommandSettings settings) | ||||
| @@ -15,5 +15,4 @@ namespace Spectre.Console.Examples | ||||
|             LogLevel.MinimumLevel = logSettings.LogLevel; | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +1,10 @@ | ||||
| using Serilog.Core; | ||||
| using Serilog.Events; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| internal class LoggingEnricher : ILogEventEnricher | ||||
| { | ||||
|     internal class LoggingEnricher : ILogEventEnricher | ||||
|     { | ||||
|     private string _cachedLogFilePath; | ||||
|     private LogEventProperty _cachedLogFilePathProperty; | ||||
|  | ||||
| @@ -34,5 +34,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         logEvent.AddPropertyIfAbsent(logFilePathProperty); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class TypeRegistrar : ITypeRegistrar | ||||
| { | ||||
|     public sealed class TypeRegistrar : ITypeRegistrar | ||||
|     { | ||||
|     private readonly IServiceCollection _builder; | ||||
|  | ||||
|     public TypeRegistrar(IServiceCollection builder) | ||||
| @@ -37,5 +37,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         _builder.AddSingleton(service, _ => func()); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class TypeResolver : ITypeResolver | ||||
| { | ||||
|     public sealed class TypeResolver : ITypeResolver | ||||
|     { | ||||
|     private readonly IServiceProvider _provider; | ||||
|  | ||||
|     public TypeResolver(IServiceProvider provider) | ||||
| @@ -17,5 +17,4 @@ namespace Spectre.Console.Examples | ||||
|     { | ||||
|         return _provider.GetRequiredService(type); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -12,10 +12,10 @@ using Spectre.Console.Cli; | ||||
|  * Spectre.Console CommandInterceptor | ||||
|  */ | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public class Program | ||||
| { | ||||
|     public class Program | ||||
|     { | ||||
|     static int Main(string[] args) | ||||
|     { | ||||
|         // to retrieve the log file name, we must first parse the command settings | ||||
| @@ -49,5 +49,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         return app.Run(args); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,9 +1,9 @@ | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         // Render panel borders | ||||
| @@ -38,7 +38,7 @@ namespace Spectre.Console.Examples | ||||
|         AnsiConsole.Write( | ||||
|             new Padder( | ||||
|                 new Columns(items).PadRight(2), | ||||
|                     new Padding(2,0,0,0))); | ||||
|                 new Padding(2, 0, 0, 0))); | ||||
|     } | ||||
|  | ||||
|     private static void TableBorders() | ||||
| @@ -86,5 +86,4 @@ namespace Spectre.Console.Examples | ||||
|         AnsiConsole.Write(new Rule($"[white bold]{title}[/]").RuleStyle("grey").LeftAligned()); | ||||
|         AnsiConsole.WriteLine(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main(string[] args) | ||||
|     { | ||||
|         AnsiConsole.WriteLine(); | ||||
| @@ -13,5 +13,4 @@ namespace Spectre.Console.Examples | ||||
|                 .AddCalendarEvent("Another event", 2020, 10, 2) | ||||
|                 .AddCalendarEvent("A third event", 2020, 10, 13)); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -5,10 +5,10 @@ Licensed under GNU Free Documentation License 1.2 | ||||
|  | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Mandelbrot | ||||
| { | ||||
|     public static class Mandelbrot | ||||
|     { | ||||
|     private const double MaxValueExtent = 2.0; | ||||
|  | ||||
|     private struct ComplexNumber | ||||
| @@ -82,5 +82,4 @@ namespace Spectre.Console.Examples | ||||
|         const double ContrastValue = 0.2; | ||||
|         return new Color(0, 0, (byte)(MaxColor * Math.Pow(value, ContrastValue))); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -3,10 +3,10 @@ using System.Reflection; | ||||
| using SixLabors.ImageSharp.Processing; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         // Draw a mandelbrot set using a Canvas | ||||
| @@ -43,5 +43,4 @@ namespace Spectre.Console.Examples | ||||
|         AnsiConsole.WriteLine(); | ||||
|         AnsiConsole.Write(canvas); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         // Render a bar chart | ||||
| @@ -37,5 +37,4 @@ namespace Spectre.Console.Examples | ||||
|                 .Padding(1, 1) | ||||
|                 .Header(title)); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         ///////////////////////////////////////////////////////////////// | ||||
| @@ -99,5 +99,4 @@ namespace Spectre.Console.Examples | ||||
|             AnsiConsole.Write(new ColorBox(width: 80, height: 15)); | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System.Collections.Generic; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         var cards = new List<Panel>(); | ||||
|             foreach(var user in User.LoadUsers()) | ||||
|         foreach (var user in User.LoadUsers()) | ||||
|         { | ||||
|             cards.Add( | ||||
|                 new Panel(GetCardContent(user)) | ||||
| @@ -26,5 +26,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         return $"[b]{name}[/]\n[yellow]{city}[/]"; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| using System.Collections.Generic; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class User | ||||
| { | ||||
|     public sealed class User | ||||
|     { | ||||
|     public string FirstName { get; set; } | ||||
|     public string LastName { get; set; } | ||||
|     public string City { get; set; } | ||||
| @@ -85,5 +85,4 @@ namespace Spectre.Console.Examples | ||||
|                 }, | ||||
|             }; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main(string[] args) | ||||
|     { | ||||
|         AnsiConsole.Write("Hello"); | ||||
| @@ -14,5 +14,4 @@ namespace Spectre.Console.Examples | ||||
|         AnsiConsole.Cursor.Move(CursorDirection.Left, 5); | ||||
|         AnsiConsole.WriteLine("Universe"); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main(string[] args) | ||||
|     { | ||||
|         // Show a known emoji | ||||
| @@ -18,5 +18,4 @@ namespace Spectre.Console.Examples | ||||
|             new Panel("[yellow]Hello :globe_showing_europe_africa:![/]") | ||||
|                 .RoundedBorder()); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using System; | ||||
| using System.Security.Authentication; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main(string[] args) | ||||
|     { | ||||
|         try | ||||
| @@ -51,7 +51,7 @@ namespace Spectre.Console.Examples | ||||
|         { | ||||
|             CheckCredentials(foo, bar); | ||||
|         } | ||||
|             catch(Exception ex) | ||||
|         catch (Exception ex) | ||||
|         { | ||||
|             throw new InvalidOperationException("Whaaat?", ex); | ||||
|         } | ||||
| @@ -61,5 +61,4 @@ namespace Spectre.Console.Examples | ||||
|     { | ||||
|         throw new InvalidCredentialException("The credentials are invalid."); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,12 +1,11 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main(string[] args) | ||||
|     { | ||||
|         AnsiConsole.Write(new FigletText("Left aligned").LeftAligned().Color(Color.Red)); | ||||
|         AnsiConsole.Write(new FigletText("Centered").Centered().Color(Color.Green)); | ||||
|         AnsiConsole.Write(new FigletText("Right aligned").RightAligned().Color(Color.Blue)); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         AnsiConsole.WriteLine(); | ||||
| @@ -18,5 +18,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         AnsiConsole.Write(grid); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         var grid = new Grid() | ||||
| @@ -28,5 +28,4 @@ namespace Spectre.Console.Examples | ||||
|     { | ||||
|         return value ? "Yes" : "No"; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         if (AnsiConsole.Profile.Capabilities.Links) | ||||
| @@ -15,5 +15,4 @@ namespace Spectre.Console.Examples | ||||
|             AnsiConsole.MarkupLine("[yellow](╯°□°)╯[/]︵ [blue]┻━┻[/]"); | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using System; | ||||
| using System.Threading; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         var table = new Table().Centered(); | ||||
| @@ -77,5 +77,4 @@ namespace Spectre.Console.Examples | ||||
|                     Update(400, () => table.Caption("[[ [blue]THE END[/] ]]")); | ||||
|             }); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     private const int NumberOfRows = 10; | ||||
|  | ||||
|     private static readonly Random _random = new(); | ||||
| @@ -82,5 +82,4 @@ namespace Spectre.Console.Examples | ||||
|  | ||||
|         return (source, dest, rate); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -10,4 +10,3 @@ Write(new Table() | ||||
|     .AddColumns("[red]Greeting[/]", "[red]Subject[/]") | ||||
|     .AddRow("[yellow]Hello[/]", "World") | ||||
|     .AddRow("[green]Oh hi[/]", "[blue u]Mark[/]")); | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         var content = new Markup( | ||||
| @@ -36,5 +36,4 @@ namespace Spectre.Console.Examples | ||||
|                 .Header("[blue]Right[/]") | ||||
|                 .HeaderAlignment(Justify.Right)); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class DescriptionGenerator | ||||
| { | ||||
|     public static class DescriptionGenerator | ||||
|     { | ||||
|     private static readonly string[] _verbs = new[] { "Downloading", "Rerouting", "Retriculating", "Collapsing", "Folding", "Solving", "Colliding", "Measuring" }; | ||||
|     private static readonly string[] _nouns = new[] { "internet", "splines", "space", "capacitators", "quarks", "algorithms", "data structures", "spacetime" }; | ||||
|  | ||||
| @@ -41,5 +41,4 @@ namespace Spectre.Console.Examples | ||||
|         return _verbs[_random.Next(0, _verbs.Length)] | ||||
|             + " " + _nouns[_random.Next(0, _nouns.Length)]; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Threading; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         AnsiConsole.MarkupLine("[yellow]Initializing warp drive[/]..."); | ||||
| @@ -85,5 +85,4 @@ namespace Spectre.Console.Examples | ||||
|             DescriptionGenerator.Generate() + | ||||
|             "[grey]...[/]"); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main(string[] args) | ||||
|     { | ||||
|         // No title | ||||
| @@ -37,5 +37,4 @@ namespace Spectre.Console.Examples | ||||
|         AnsiConsole.Write(rule); | ||||
|         AnsiConsole.WriteLine(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class ExceptionGenerator | ||||
| { | ||||
|     public static class ExceptionGenerator | ||||
|     { | ||||
|     public static Exception GenerateException() | ||||
|     { | ||||
|         try | ||||
| @@ -26,5 +26,4 @@ namespace Spectre.Console.Examples | ||||
|     { | ||||
|         throw new InvalidOperationException("Something went very wrong!"); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static partial class Program | ||||
| { | ||||
|     public static partial class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         var table = new Table().HideHeaders().NoBorder(); | ||||
| @@ -149,5 +149,4 @@ namespace Spectre.Console.Examples | ||||
|             .AddItem("PowerShell", 13, Color.Red) | ||||
|             .AddItem("Bash", 5, Color.Blue); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| using System.Threading; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         AnsiConsole.Status() | ||||
| @@ -65,5 +65,4 @@ namespace Spectre.Console.Examples | ||||
|     { | ||||
|         AnsiConsole.MarkupLine($"[grey]LOG:[/] {message}[grey]...[/]"); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         AnsiConsole.Write(CreateTable()); | ||||
| @@ -41,5 +41,4 @@ namespace Spectre.Console.Examples | ||||
|             .AddRow(second, new Text("Whaaat"), new Text("Lol")) | ||||
|             .AddRow(new Markup("[blue]Hej[/]").Centered(), new Markup("[yellow]Världen![/]"), Text.Empty); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class Program | ||||
| { | ||||
|     public static class Program | ||||
|     { | ||||
|     public static void Main() | ||||
|     { | ||||
|         AnsiConsole.WriteLine(); | ||||
| @@ -39,5 +39,4 @@ namespace Spectre.Console.Examples | ||||
|         // Return the tree | ||||
|         return tree; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -2,10 +2,10 @@ using System; | ||||
| using System.Collections.Generic; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public sealed class ColorBox : Renderable | ||||
| { | ||||
|     public sealed class ColorBox : Renderable | ||||
|     { | ||||
|     private readonly int _height; | ||||
|     private int? _width; | ||||
|  | ||||
| @@ -120,5 +120,4 @@ namespace Spectre.Console.Examples | ||||
|             return temp1; | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Examples | ||||
| namespace Spectre.Console.Examples; | ||||
|  | ||||
| public static class ColorExtensions | ||||
| { | ||||
|     public static class ColorExtensions | ||||
|     { | ||||
|     public static Color GetInvertedColor(this Color color) | ||||
|     { | ||||
|         return GetLuminance(color) < 140 ? Color.White : Color.Black; | ||||
| @@ -11,5 +11,4 @@ namespace Spectre.Console.Examples | ||||
|     { | ||||
|         return (float)((0.2126 * color.R) + (0.7152 * color.G) + (0.0722 * color.B)); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <Project> | ||||
|   <PropertyGroup Label="Settings"> | ||||
|     <Deterministic>true</Deterministic> | ||||
|     <LangVersion>9.0</LangVersion> | ||||
|     <LangVersion>10</LangVersion> | ||||
|     <DebugSymbols>true</DebugSymbols> | ||||
|     <DebugType>embedded</DebugType> | ||||
|     <MinVerSkip Condition="'$(Configuration)' == 'Debug'">true</MinVerSkip> | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| namespace Spectre.Console.Analyzer.Sandbox | ||||
| namespace Spectre.Console.Analyzer.Sandbox; | ||||
|  | ||||
| /// <summary> | ||||
| /// Sample sandbox for testing out analyzers. | ||||
| /// </summary> | ||||
| public static class Program | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Sample sandbox for testing out analyzers. | ||||
|     /// </summary> | ||||
|     public static class Program | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// The program's entry point. | ||||
|     /// </summary> | ||||
| @@ -12,5 +12,4 @@ namespace Spectre.Console.Analyzer.Sandbox | ||||
|     { | ||||
|         AnsiConsole.WriteLine("Project is set up with a reference to Spectre.Console.Analyzer"); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -6,14 +6,14 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using Microsoft.CodeAnalysis.Diagnostics; | ||||
| using Microsoft.CodeAnalysis.Operations; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| /// <summary> | ||||
| /// Analyzer to suggest using available instances of AnsiConsole over the static methods. | ||||
| /// </summary> | ||||
| [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
| public class FavorInstanceAnsiConsoleOverStaticAnalyzer : SpectreAnalyzer | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Analyzer to suggest using available instances of AnsiConsole over the static methods. | ||||
|     /// </summary> | ||||
|     [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
|     public class FavorInstanceAnsiConsoleOverStaticAnalyzer : SpectreAnalyzer | ||||
|     { | ||||
|     private static readonly DiagnosticDescriptor _diagnosticDescriptor = | ||||
|         Descriptors.S1010_FavorInstanceAnsiConsoleOverStatic; | ||||
|  | ||||
| @@ -91,5 +91,4 @@ namespace Spectre.Console.Analyzer | ||||
|                 i.Declaration.Type.NormalizeWhitespace().ToString() == "IAnsiConsole" && | ||||
|                 (!isStatic ^ i.Modifiers.Any(modifier => modifier.Kind() == SyntaxKind.StaticKeyword))); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -7,15 +7,15 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using Microsoft.CodeAnalysis.Diagnostics; | ||||
| using Microsoft.CodeAnalysis.Operations; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| /// <summary> | ||||
| /// Analyzer to detect calls to live renderables within a live renderable context. | ||||
| /// </summary> | ||||
| [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
| [Shared] | ||||
| public class NoConcurrentLiveRenderablesAnalyzer : SpectreAnalyzer | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Analyzer to detect calls to live renderables within a live renderable context. | ||||
|     /// </summary> | ||||
|     [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
|     [Shared] | ||||
|     public class NoConcurrentLiveRenderablesAnalyzer : SpectreAnalyzer | ||||
|     { | ||||
|     private static readonly DiagnosticDescriptor _diagnosticDescriptor = | ||||
|         Descriptors.S1020_AvoidConcurrentCallsToMultipleLiveRenderables; | ||||
|  | ||||
| @@ -74,5 +74,4 @@ namespace Spectre.Console.Analyzer | ||||
|                         displayString)); | ||||
|             }, OperationKind.Invocation); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -7,15 +7,15 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using Microsoft.CodeAnalysis.Diagnostics; | ||||
| using Microsoft.CodeAnalysis.Operations; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| /// <summary> | ||||
| /// Analyzer to detect calls to live renderables within a live renderable context. | ||||
| /// </summary> | ||||
| [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
| [Shared] | ||||
| public class NoPromptsDuringLiveRenderablesAnalyzer : SpectreAnalyzer | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Analyzer to detect calls to live renderables within a live renderable context. | ||||
|     /// </summary> | ||||
|     [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
|     [Shared] | ||||
|     public class NoPromptsDuringLiveRenderablesAnalyzer : SpectreAnalyzer | ||||
|     { | ||||
|     private static readonly DiagnosticDescriptor _diagnosticDescriptor = | ||||
|         Descriptors.S1021_AvoidPromptCallsDuringLiveRenderables; | ||||
|  | ||||
| @@ -80,5 +80,4 @@ namespace Spectre.Console.Analyzer | ||||
|                         displayString)); | ||||
|             }, OperationKind.Invocation); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using Microsoft.CodeAnalysis.Diagnostics; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| /// <summary> | ||||
| /// Base class for Spectre analyzers. | ||||
| /// </summary> | ||||
| public abstract class SpectreAnalyzer : DiagnosticAnalyzer | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Base class for Spectre analyzers. | ||||
|     /// </summary> | ||||
|     public abstract class SpectreAnalyzer : DiagnosticAnalyzer | ||||
|     { | ||||
|     /// <inheritdoc /> | ||||
|     public override void Initialize(AnalysisContext context) | ||||
|     { | ||||
| @@ -21,5 +21,4 @@ namespace Spectre.Console.Analyzer | ||||
|     /// </summary> | ||||
|     /// <param name="compilationStartContext">Compilation Start Analysis Context.</param> | ||||
|     protected abstract void AnalyzeCompilation(CompilationStartAnalysisContext compilationStartContext); | ||||
|     } | ||||
| } | ||||
| @@ -4,14 +4,14 @@ using Microsoft.CodeAnalysis.CSharp; | ||||
| using Microsoft.CodeAnalysis.Diagnostics; | ||||
| using Microsoft.CodeAnalysis.Operations; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| /// <summary> | ||||
| /// Analyzer to enforce the use of AnsiConsole over System.Console for known methods. | ||||
| /// </summary> | ||||
| [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
| public class UseSpectreInsteadOfSystemConsoleAnalyzer : SpectreAnalyzer | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Analyzer to enforce the use of AnsiConsole over System.Console for known methods. | ||||
|     /// </summary> | ||||
|     [DiagnosticAnalyzer(LanguageNames.CSharp)] | ||||
|     public class UseSpectreInsteadOfSystemConsoleAnalyzer : SpectreAnalyzer | ||||
|     { | ||||
|     private static readonly DiagnosticDescriptor _diagnosticDescriptor = | ||||
|         Descriptors.S1000_UseAnsiConsoleOverSystemConsole; | ||||
|  | ||||
| @@ -59,5 +59,4 @@ namespace Spectre.Console.Analyzer | ||||
|                         displayString)); | ||||
|             }, OperationKind.Invocation); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| internal static class Constants | ||||
| { | ||||
|     internal static class Constants | ||||
|     { | ||||
|     internal const string StaticInstance = "AnsiConsole"; | ||||
|     internal const string SpectreConsole = "Spectre.Console"; | ||||
|  | ||||
| @@ -11,5 +11,4 @@ namespace Spectre.Console.Analyzer | ||||
|         "Spectre.Console.Progress", | ||||
|         "Spectre.Console.Status", | ||||
|     }; | ||||
|     } | ||||
| } | ||||
| @@ -3,13 +3,13 @@ using Microsoft.CodeAnalysis; | ||||
| using static Microsoft.CodeAnalysis.DiagnosticSeverity; | ||||
| using static Spectre.Console.Analyzer.Descriptors.Category; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| /// <summary> | ||||
| /// Code analysis descriptors. | ||||
| /// </summary> | ||||
| public static class Descriptors | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Code analysis descriptors. | ||||
|     /// </summary> | ||||
|     public static class Descriptors | ||||
|     { | ||||
|     internal enum Category | ||||
|     { | ||||
|         Usage, // 1xxx | ||||
| @@ -75,5 +75,4 @@ namespace Spectre.Console.Analyzer | ||||
|             Usage, | ||||
|             Warning, | ||||
|             "Avoid prompting for input while a current renderable is running."); | ||||
|     } | ||||
| } | ||||
| @@ -7,13 +7,13 @@ using Microsoft.CodeAnalysis.CSharp; | ||||
| using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer.CodeActions | ||||
| namespace Spectre.Console.Analyzer.CodeActions; | ||||
|  | ||||
| /// <summary> | ||||
| /// Code action to change calls to System.Console to AnsiConsole. | ||||
| /// </summary> | ||||
| public class SwitchToAnsiConsoleAction : CodeAction | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Code action to change calls to System.Console to AnsiConsole. | ||||
|     /// </summary> | ||||
|     public class SwitchToAnsiConsoleAction : CodeAction | ||||
|     { | ||||
|     private readonly Document _document; | ||||
|     private readonly InvocationExpressionSyntax _originalInvocation; | ||||
|  | ||||
| @@ -112,5 +112,4 @@ namespace Spectre.Console.Analyzer.CodeActions | ||||
|                     .WithLeadingTrivia(_originalInvocation.GetLeadingTrivia())) | ||||
|         .Expression; | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -6,15 +6,15 @@ using Microsoft.CodeAnalysis.CodeFixes; | ||||
| using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using Spectre.Console.Analyzer.CodeActions; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer.FixProviders | ||||
| namespace Spectre.Console.Analyzer.FixProviders; | ||||
|  | ||||
| /// <summary> | ||||
| /// Fix provider to change System.Console calls to AnsiConsole calls. | ||||
| /// </summary> | ||||
| [ExportCodeFixProvider(LanguageNames.CSharp)] | ||||
| [Shared] | ||||
| public class StaticAnsiConsoleToInstanceFix : CodeFixProvider | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Fix provider to change System.Console calls to AnsiConsole calls. | ||||
|     /// </summary> | ||||
|     [ExportCodeFixProvider(LanguageNames.CSharp)] | ||||
|     [Shared] | ||||
|     public class StaticAnsiConsoleToInstanceFix : CodeFixProvider | ||||
|     { | ||||
|     /// <inheritdoc /> | ||||
|     public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create( | ||||
|         Descriptors.S1010_FavorInstanceAnsiConsoleOverStatic.Id); | ||||
| @@ -31,5 +31,4 @@ namespace Spectre.Console.Analyzer.FixProviders | ||||
|             new SwitchToAnsiConsoleAction(context.Document, methodDeclaration, "Convert static AnsiConsole calls to local instance."), | ||||
|             context.Diagnostics); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -6,15 +6,15 @@ using Microsoft.CodeAnalysis.CodeFixes; | ||||
| using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using Spectre.Console.Analyzer.CodeActions; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer.FixProviders | ||||
| namespace Spectre.Console.Analyzer.FixProviders; | ||||
|  | ||||
| /// <summary> | ||||
| /// Fix provider to change System.Console calls to AnsiConsole calls. | ||||
| /// </summary> | ||||
| [ExportCodeFixProvider(LanguageNames.CSharp)] | ||||
| [Shared] | ||||
| public class SystemConsoleToAnsiConsoleFix : CodeFixProvider | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Fix provider to change System.Console calls to AnsiConsole calls. | ||||
|     /// </summary> | ||||
|     [ExportCodeFixProvider(LanguageNames.CSharp)] | ||||
|     [Shared] | ||||
|     public class SystemConsoleToAnsiConsoleFix : CodeFixProvider | ||||
|     { | ||||
|     /// <inheritdoc /> | ||||
|     public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create( | ||||
|         Descriptors.S1000_UseAnsiConsoleOverSystemConsole.Id); | ||||
| @@ -31,5 +31,4 @@ namespace Spectre.Console.Analyzer.FixProviders | ||||
|             new SwitchToAnsiConsoleAction(context.Document, methodDeclaration, "Convert static call to AnsiConsole to Spectre.Console.AnsiConsole"), | ||||
|             context.Diagnostics); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +1,9 @@ | ||||
| using Microsoft.CodeAnalysis.CSharp.Syntax; | ||||
| using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; | ||||
|  | ||||
| namespace Spectre.Console.Analyzer | ||||
| namespace Spectre.Console.Analyzer; | ||||
|  | ||||
| internal static class Syntax | ||||
| { | ||||
|     internal static class Syntax | ||||
|     { | ||||
|     public static readonly UsingDirectiveSyntax SpectreUsing = UsingDirective(QualifiedName(IdentifierName("Spectre"), IdentifierName("Console"))); | ||||
|     } | ||||
| } | ||||
| @@ -6,13 +6,13 @@ using SixLabors.ImageSharp.Processing; | ||||
| using SixLabors.ImageSharp.Processing.Processors.Transforms; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents a renderable image. | ||||
| /// </summary> | ||||
| public sealed class CanvasImage : Renderable | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents a renderable image. | ||||
|     /// </summary> | ||||
|     public sealed class CanvasImage : Renderable | ||||
|     { | ||||
|     private static readonly IResampler _defaultResampler = KnownResamplers.Bicubic; | ||||
|  | ||||
|     /// <summary> | ||||
| @@ -140,5 +140,4 @@ namespace Spectre.Console | ||||
|  | ||||
|         return ((IRenderable)canvas).Render(context, maxWidth); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using SixLabors.ImageSharp.Processing; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Contains extension methods for <see cref="CanvasImage"/>. | ||||
| /// </summary> | ||||
| public static class CanvasImageExtensions | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Contains extension methods for <see cref="CanvasImage"/>. | ||||
|     /// </summary> | ||||
|     public static class CanvasImageExtensions | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Sets the maximum width of the rendered image. | ||||
|     /// </summary> | ||||
| @@ -131,5 +131,4 @@ namespace Spectre.Console | ||||
|         image.Resampler = KnownResamplers.NearestNeighbor; | ||||
|         return image; | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| 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 | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A <see cref="ICommandInterceptor"/> that triggers a callback when invoked. | ||||
|     /// </summary> | ||||
|     public sealed class CallbackCommandInterceptor : ICommandInterceptor | ||||
|     { | ||||
|     private readonly Action<CommandContext, CommandSettings> _callback; | ||||
|  | ||||
|     /// <summary> | ||||
| @@ -24,5 +24,4 @@ namespace Spectre.Console.Testing | ||||
|     { | ||||
|         _callback(context, settings); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents a <see cref="CommandApp"/> runtime failure. | ||||
| /// </summary> | ||||
| public sealed class CommandAppFailure | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents a <see cref="CommandApp"/> runtime failure. | ||||
|     /// </summary> | ||||
|     public sealed class CommandAppFailure | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Gets the exception that was thrown. | ||||
|     /// </summary> | ||||
| @@ -25,5 +25,4 @@ namespace Spectre.Console.Testing | ||||
|             .TrimLines() | ||||
|             .Trim(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,12 +1,12 @@ | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents the result of a completed <see cref="CommandApp"/> run. | ||||
| /// </summary> | ||||
| public sealed class CommandAppResult | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents the result of a completed <see cref="CommandApp"/> run. | ||||
|     /// </summary> | ||||
|     public sealed class CommandAppResult | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Gets the exit code. | ||||
|     /// </summary> | ||||
| @@ -39,5 +39,4 @@ namespace Spectre.Console.Testing | ||||
|             .TrimLines() | ||||
|             .Trim(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// A <see cref="CommandApp"/> test harness. | ||||
| /// </summary> | ||||
| public sealed class CommandAppTester | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A <see cref="CommandApp"/> test harness. | ||||
|     /// </summary> | ||||
|     public sealed class CommandAppTester | ||||
|     { | ||||
|     private Action<CommandApp>? _appConfiguration; | ||||
|     private Action<IConfigurator>? _configuration; | ||||
|  | ||||
| @@ -131,5 +131,4 @@ namespace Spectre.Console.Testing | ||||
|  | ||||
|         return new CommandAppResult(result, output, context, settings); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,14 +1,14 @@ | ||||
| using System; | ||||
| using Spectre.Console.Cli; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// This is a utility class for implementors of | ||||
| /// <see cref="ITypeRegistrar"/> and corresponding <see cref="ITypeResolver"/>. | ||||
| /// </summary> | ||||
| public sealed class TypeRegistrarBaseTests | ||||
| { | ||||
|     /// <summary> | ||||
|     /// This is a utility class for implementors of | ||||
|     /// <see cref="ITypeRegistrar"/> and corresponding <see cref="ITypeResolver"/>. | ||||
|     /// </summary> | ||||
|     public sealed class TypeRegistrarBaseTests | ||||
|     { | ||||
|     private readonly Func<ITypeRegistrar> _registrarFactory; | ||||
|  | ||||
|     /// <summary> | ||||
| @@ -187,5 +187,4 @@ namespace Spectre.Console.Testing | ||||
|         { | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System.Collections.Generic; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Contains extensions for <see cref="string"/>. | ||||
| /// </summary> | ||||
| public static class StringExtensions | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Contains extensions for <see cref="string"/>. | ||||
|     /// </summary> | ||||
|     public static class StringExtensions | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Returns a new string with all lines trimmed of trailing whitespace. | ||||
|     /// </summary> | ||||
| @@ -43,5 +43,4 @@ namespace Spectre.Console.Testing | ||||
|  | ||||
|         return string.Empty; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Contains extensions for <see cref="Style"/>. | ||||
| /// </summary> | ||||
| public static class StyleExtensions | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Contains extensions for <see cref="Style"/>. | ||||
|     /// </summary> | ||||
|     public static class StyleExtensions | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Sets the foreground or background color of the specified style. | ||||
|     /// </summary> | ||||
| @@ -21,5 +21,4 @@ namespace Spectre.Console.Testing | ||||
|  | ||||
|         return style.Background(color); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| internal sealed class NoopCursor : IAnsiConsoleCursor | ||||
| { | ||||
|     internal sealed class NoopCursor : IAnsiConsoleCursor | ||||
|     { | ||||
|     public void Move(CursorDirection direction, int steps) | ||||
|     { | ||||
|     } | ||||
| @@ -13,5 +13,4 @@ namespace Spectre.Console.Testing | ||||
|     public void Show(bool show) | ||||
|     { | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| using System; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| internal sealed class NoopExclusivityMode : IExclusivityMode | ||||
| { | ||||
|     internal sealed class NoopExclusivityMode : IExclusivityMode | ||||
|     { | ||||
|     public T Run<T>(Func<T> func) | ||||
|     { | ||||
|         return func(); | ||||
| @@ -14,5 +14,4 @@ namespace Spectre.Console.Testing | ||||
|     { | ||||
|         return await func().ConfigureAwait(false); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,12 +1,12 @@ | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents fake capabilities useful in tests. | ||||
| /// </summary> | ||||
| public sealed class TestCapabilities : IReadOnlyCapabilities | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents fake capabilities useful in tests. | ||||
|     /// </summary> | ||||
|     public sealed class TestCapabilities : IReadOnlyCapabilities | ||||
|     { | ||||
|     /// <inheritdoc/> | ||||
|     public ColorSystem ColorSystem { get; set; } = ColorSystem.TrueColor; | ||||
|  | ||||
| @@ -36,5 +36,4 @@ namespace Spectre.Console.Testing | ||||
|     { | ||||
|         return new RenderContext(this); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -3,13 +3,13 @@ using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// A testable console. | ||||
| /// </summary> | ||||
| public sealed class TestConsole : IAnsiConsole, IDisposable | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A testable console. | ||||
|     /// </summary> | ||||
|     public sealed class TestConsole : IAnsiConsole, IDisposable | ||||
|     { | ||||
|     private readonly IAnsiConsole _console; | ||||
|     private readonly StringWriter _writer; | ||||
|     private IAnsiConsoleCursor? _cursor; | ||||
| @@ -118,5 +118,4 @@ namespace Spectre.Console.Testing | ||||
|     { | ||||
|         _cursor = cursor; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,10 +1,10 @@ | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Contains extensions for <see cref="TestConsole"/>. | ||||
| /// </summary> | ||||
| public static class TestConsoleExtensions | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Contains extensions for <see cref="TestConsole"/>. | ||||
|     /// </summary> | ||||
|     public static class TestConsoleExtensions | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Sets the console's color system. | ||||
|     /// </summary> | ||||
| @@ -63,5 +63,4 @@ namespace Spectre.Console.Testing | ||||
|         console.EmitAnsiSequences = true; | ||||
|         return console; | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -3,13 +3,13 @@ using System.Collections.Generic; | ||||
| using System.Threading; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| namespace Spectre.Console.Testing | ||||
| namespace Spectre.Console.Testing; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents a testable console input mechanism. | ||||
| /// </summary> | ||||
| public sealed class TestConsoleInput : IAnsiConsoleInput | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents a testable console input mechanism. | ||||
|     /// </summary> | ||||
|     public sealed class TestConsoleInput : IAnsiConsoleInput | ||||
|     { | ||||
|     private readonly Queue<ConsoleKeyInfo> _input; | ||||
|  | ||||
|     /// <summary> | ||||
| @@ -88,5 +88,4 @@ namespace Spectre.Console.Testing | ||||
|     { | ||||
|         return Task.FromResult(ReadKey(intercept)); | ||||
|     } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Writes an exception to the console. | ||||
|     /// </summary> | ||||
| @@ -26,5 +26,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Console.WriteException(exception, settings); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Creates a new <see cref="LiveDisplay"/> instance. | ||||
|     /// </summary> | ||||
| @@ -16,5 +16,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         return Console.Live(target); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Writes the specified markup to the console. | ||||
|     /// </summary> | ||||
| @@ -66,5 +66,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Console.MarkupLine(provider, format, args); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +1,10 @@ | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Creates a new <see cref="Progress"/> instance. | ||||
|     /// </summary> | ||||
| @@ -22,5 +22,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         return Console.Status(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Displays a prompt to the user. | ||||
|     /// </summary> | ||||
| @@ -62,5 +62,4 @@ namespace Spectre.Console | ||||
|         } | ||||
|         .Show(Console); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Starts recording the console output. | ||||
|     /// </summary> | ||||
| @@ -66,5 +66,4 @@ namespace Spectre.Console | ||||
|  | ||||
|         return _recorder.Export(encoder); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Renders the specified object to the console. | ||||
|     /// </summary> | ||||
| @@ -31,5 +31,4 @@ namespace Spectre.Console | ||||
|  | ||||
|         Console.Write(renderable); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Switches to an alternate screen buffer if the terminal supports it. | ||||
|     /// </summary> | ||||
| @@ -15,5 +15,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Console.AlternateScreen(action); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +1,10 @@ | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     internal static Style CurrentStyle { get; private set; } = Style.Plain; | ||||
|     internal static bool Created { get; private set; } | ||||
|  | ||||
| @@ -59,5 +59,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         CurrentStyle = Style.Plain; | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using System.Globalization; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Writes the specified string value to the console. | ||||
|     /// </summary> | ||||
| @@ -249,5 +249,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Console.Write(string.Format(provider, format, args), CurrentStyle); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System; | ||||
| using System.Globalization; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Writes an empty line to the console. | ||||
|     /// </summary> | ||||
| @@ -269,5 +269,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Console.WriteLine(string.Format(provider, format, args), CurrentStyle); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// A console capable of writing ANSI escape sequences. | ||||
| /// </summary> | ||||
| public static partial class AnsiConsole | ||||
| { | ||||
|     /// <summary> | ||||
|     /// A console capable of writing ANSI escape sequences. | ||||
|     /// </summary> | ||||
|     public static partial class AnsiConsole | ||||
|     { | ||||
|     private static Recorder? _recorder; | ||||
|     private static Lazy<IAnsiConsole> _console = new Lazy<IAnsiConsole>( | ||||
|         () => | ||||
| @@ -74,5 +74,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Console.Clear(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -3,13 +3,13 @@ using System.Runtime.InteropServices; | ||||
| using Spectre.Console.Enrichment; | ||||
| using Spectre.Console.Internal; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Factory for creating an ANSI console. | ||||
| /// </summary> | ||||
| public sealed class AnsiConsoleFactory | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Factory for creating an ANSI console. | ||||
|     /// </summary> | ||||
|     public sealed class AnsiConsoleFactory | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Creates an ANSI console. | ||||
|     /// </summary> | ||||
| @@ -108,5 +108,4 @@ namespace Spectre.Console | ||||
|  | ||||
|         return (supportsAnsi, legacyConsole); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -2,13 +2,13 @@ using System; | ||||
| using System.IO; | ||||
| using System.Text; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents console output. | ||||
| /// </summary> | ||||
| public sealed class AnsiConsoleOutput : IAnsiConsoleOutput | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents console output. | ||||
|     /// </summary> | ||||
|     public sealed class AnsiConsoleOutput : IAnsiConsoleOutput | ||||
|     { | ||||
|     /// <inheritdoc/> | ||||
|     public TextWriter Writer { get; } | ||||
|  | ||||
| @@ -54,5 +54,4 @@ namespace Spectre.Console | ||||
|             System.Console.OutputEncoding = encoding; | ||||
|         } | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using System.Collections.Generic; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Settings used when building a <see cref="IAnsiConsole"/>. | ||||
| /// </summary> | ||||
| public sealed class AnsiConsoleSettings | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Settings used when building a <see cref="IAnsiConsole"/>. | ||||
|     /// </summary> | ||||
|     public sealed class AnsiConsoleSettings | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Gets or sets a value indicating whether or | ||||
|     /// not ANSI escape sequences are supported. | ||||
| @@ -52,5 +52,4 @@ namespace Spectre.Console | ||||
|     { | ||||
|         Enrichment = new ProfileEnrichment(); | ||||
|     } | ||||
|     } | ||||
| } | ||||
| @@ -1,10 +1,10 @@ | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Determines ANSI escape sequence support. | ||||
| /// </summary> | ||||
| public enum AnsiSupport | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Determines ANSI escape sequence support. | ||||
|     /// </summary> | ||||
|     public enum AnsiSupport | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// ANSI escape sequence support should | ||||
|     /// be detected by the system. | ||||
| @@ -20,5 +20,4 @@ namespace Spectre.Console | ||||
|     /// ANSI escape sequences are not supported. | ||||
|     /// </summary> | ||||
|     No = 2, | ||||
|     } | ||||
| } | ||||
| @@ -1,13 +1,13 @@ | ||||
| using System.Diagnostics.CodeAnalysis; | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents a border. | ||||
| /// </summary> | ||||
| public abstract partial class BoxBorder | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents a border. | ||||
|     /// </summary> | ||||
|     public abstract partial class BoxBorder | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Gets an invisible border. | ||||
|     /// </summary> | ||||
| @@ -38,5 +38,4 @@ namespace Spectre.Console | ||||
|     /// Gets a square border. | ||||
|     /// </summary> | ||||
|     public static BoxBorder Square { get; } = new SquareBoxBorder(); | ||||
|     } | ||||
| } | ||||
| @@ -1,12 +1,12 @@ | ||||
| using Spectre.Console.Rendering; | ||||
|  | ||||
| namespace Spectre.Console | ||||
| namespace Spectre.Console; | ||||
|  | ||||
| /// <summary> | ||||
| /// Represents a border. | ||||
| /// </summary> | ||||
| public abstract partial class BoxBorder | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Represents a border. | ||||
|     /// </summary> | ||||
|     public abstract partial class BoxBorder | ||||
|     { | ||||
|     /// <summary> | ||||
|     /// Gets the safe border for this border or <c>null</c> if none exist. | ||||
|     /// </summary> | ||||
| @@ -18,5 +18,4 @@ namespace Spectre.Console | ||||
|     /// <param name="part">The part to get the character representation for.</param> | ||||
|     /// <returns>A character representation of the specified border part.</returns> | ||||
|     public abstract string GetPart(BoxBorderPart part); | ||||
|     } | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user