From ba4ab0c8c6aab183a704ab2016f6c765a27b9d5c Mon Sep 17 00:00:00 2001 From: BDisp Date: Sun, 14 Jul 2024 18:34:57 +0100 Subject: [PATCH] Involving assertive code within a region. --- SelfContained/Program.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SelfContained/Program.cs b/SelfContained/Program.cs index f2f157670..b16c8cd3e 100644 --- a/SelfContained/Program.cs +++ b/SelfContained/Program.cs @@ -1,5 +1,6 @@ // This is a simple example application for a self-contained single file. +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using Terminal.Gui; @@ -13,16 +14,20 @@ public static class Program { Application.Init (); + #region The code in this region is not intended for use in a self-contained single-file. It's just here to make sure there is no functionality break with localization in Terminal.Gui using single-file + if (Equals (Thread.CurrentThread.CurrentUICulture, CultureInfo.InvariantCulture)) { - System.Diagnostics.Debug.Assert (Application.SupportedCultures.Count == 0); + Debug.Assert (Application.SupportedCultures.Count == 0); } else { - System.Diagnostics.Debug.Assert (Application.SupportedCultures.Count == 4); - System.Diagnostics.Debug.Assert (Equals (CultureInfo.CurrentCulture, Thread.CurrentThread.CurrentUICulture)); + Debug.Assert (Application.SupportedCultures.Count == 4); + Debug.Assert (Equals (CultureInfo.CurrentCulture, Thread.CurrentThread.CurrentUICulture)); } + #endregion + ExampleWindow app = new (); Application.Run (app);