Explorar o código

Involving assertive code within a region.

BDisp hai 1 ano
pai
achega
ba4ab0c8c6
Modificáronse 1 ficheiros con 8 adicións e 3 borrados
  1. 8 3
      SelfContained/Program.cs

+ 8 - 3
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);