diff --git a/TUI.Cli/AssemblyInfo.cs b/TUI.Cli/AssemblyInfo.cs new file mode 100644 index 0000000..d771f7e --- /dev/null +++ b/TUI.Cli/AssemblyInfo.cs @@ -0,0 +1,3 @@ +// Copyright (c) 2023-2026 ktsu-dev contributors + +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("ktsu.TUI.Test")] diff --git a/TUI.Cli/SampleCLI.cs b/TUI.Cli/SampleCLI.cs index 3d44e99..a7a5613 100644 --- a/TUI.Cli/SampleCLI.cs +++ b/TUI.Cli/SampleCLI.cs @@ -1,13 +1,12 @@ // Copyright (c) 2023-2026 ktsu-dev contributors -using ktsu.TUI.Core.Contracts; +namespace ktsu.TUI.Cli; + using ktsu.TUI.Core.Elements.Layouts; using ktsu.TUI.Core.Elements.Primitives; using ktsu.TUI.Core.Models; using ktsu.TUI.Core.Services; -namespace ktsu.TUI.Cli; - /// /// A sample CLI application demonstrating the TUI library /// @@ -19,26 +18,26 @@ public static class SampleCLI public static async Task Main() { // Create console provider - var consoleProvider = new SpectreConsoleProvider(); + SpectreConsoleProvider consoleProvider = new(); // Create application - var app = new UIApplication(consoleProvider); + UIApplication app = new(consoleProvider); // Create a demo UI - var rootPanel = CreateDemoUI(); + StackPanel rootPanel = CreateDemoUI(); app.Setup(rootPanel); // Run the application Console.WriteLine("Starting TUI CLI Demo. Press ESC to exit."); - await app.RunAsync(); + await app.RunAsync().ConfigureAwait(false); Console.WriteLine("TUI CLI Demo finished."); } - private static IUIElement CreateDemoUI() + private static StackPanel CreateDemoUI() { // Create main container - var mainPanel = new StackPanel + StackPanel mainPanel = new() { Orientation = Orientation.Vertical, Spacing = 1, @@ -46,7 +45,7 @@ private static IUIElement CreateDemoUI() }; // Add title - var title = new BorderElement + BorderElement title = new() { Title = "TUI Library CLI Demo", TitleAlignment = HorizontalAlignment.Center, @@ -61,7 +60,7 @@ private static IUIElement CreateDemoUI() }; // Add description - var description = new TextElement + TextElement description = new() { Text = "This demonstrates the TUI library's capabilities:\n" + "• Text rendering with styling\n" + @@ -73,10 +72,10 @@ private static IUIElement CreateDemoUI() }; // Add instructions - var instructions = new BorderElement + BorderElement instructions = new() { Title = "Instructions", - BorderStyle = BorderStyle.SingleLine, + BorderStyle = BorderStyle.SingleLine, Child = new TextElement { Text = "Press ESC to exit the application",