mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	Use file scoped namespace declarations
This commit is contained in:
		
				
					committed by
					
						
						Phil Scott
					
				
			
			
				
	
			
			
			
						parent
						
							1dbaf50935
						
					
				
				
					commit
					ec1188b837
				
			@@ -1,41 +1,40 @@
 | 
			
		||||
namespace Spectre.Console.Examples
 | 
			
		||||
namespace Spectre.Console.Examples;
 | 
			
		||||
 | 
			
		||||
public static class Program
 | 
			
		||||
{
 | 
			
		||||
    public static class Program
 | 
			
		||||
    public static void Main(string[] args)
 | 
			
		||||
    {
 | 
			
		||||
        public static void Main(string[] args)
 | 
			
		||||
        {
 | 
			
		||||
            // No title
 | 
			
		||||
            Render(
 | 
			
		||||
                new Rule()
 | 
			
		||||
                    .RuleStyle(Style.Parse("yellow"))
 | 
			
		||||
                    .AsciiBorder()
 | 
			
		||||
                    .LeftAligned());
 | 
			
		||||
        // No title
 | 
			
		||||
        Render(
 | 
			
		||||
            new Rule()
 | 
			
		||||
                .RuleStyle(Style.Parse("yellow"))
 | 
			
		||||
                .AsciiBorder()
 | 
			
		||||
                .LeftAligned());
 | 
			
		||||
 | 
			
		||||
            // Left aligned title
 | 
			
		||||
            Render(
 | 
			
		||||
                new Rule("[blue]Left aligned[/]")
 | 
			
		||||
                    .RuleStyle(Style.Parse("red"))
 | 
			
		||||
                    .DoubleBorder()
 | 
			
		||||
                    .LeftAligned());
 | 
			
		||||
        // Left aligned title
 | 
			
		||||
        Render(
 | 
			
		||||
            new Rule("[blue]Left aligned[/]")
 | 
			
		||||
                .RuleStyle(Style.Parse("red"))
 | 
			
		||||
                .DoubleBorder()
 | 
			
		||||
                .LeftAligned());
 | 
			
		||||
 | 
			
		||||
            // Centered title
 | 
			
		||||
            Render(
 | 
			
		||||
                new Rule("[green]Centered[/]")
 | 
			
		||||
                    .RuleStyle(Style.Parse("green"))
 | 
			
		||||
                    .HeavyBorder()
 | 
			
		||||
                    .Centered());
 | 
			
		||||
        // Centered title
 | 
			
		||||
        Render(
 | 
			
		||||
            new Rule("[green]Centered[/]")
 | 
			
		||||
                .RuleStyle(Style.Parse("green"))
 | 
			
		||||
                .HeavyBorder()
 | 
			
		||||
                .Centered());
 | 
			
		||||
 | 
			
		||||
            // Right aligned title
 | 
			
		||||
            Render(
 | 
			
		||||
                new Rule("[red]Right aligned[/]")
 | 
			
		||||
                    .RuleStyle(Style.Parse("blue"))
 | 
			
		||||
                    .RightAligned());
 | 
			
		||||
        }
 | 
			
		||||
        // Right aligned title
 | 
			
		||||
        Render(
 | 
			
		||||
            new Rule("[red]Right aligned[/]")
 | 
			
		||||
                .RuleStyle(Style.Parse("blue"))
 | 
			
		||||
                .RightAligned());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        private static void Render(Rule rule)
 | 
			
		||||
        {
 | 
			
		||||
            AnsiConsole.Write(rule);
 | 
			
		||||
            AnsiConsole.WriteLine();
 | 
			
		||||
        }
 | 
			
		||||
    private static void Render(Rule rule)
 | 
			
		||||
    {
 | 
			
		||||
        AnsiConsole.Write(rule);
 | 
			
		||||
        AnsiConsole.WriteLine();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user