Преглед на файлове

Removes unnecessary driver parameter.

BDisp преди 1 година
родител
ревизия
37d237aad9
променени са 2 файла, в които са добавени 4 реда и са изтрити 9 реда
  1. 2 7
      Terminal.Gui/Application/Application.cs
  2. 2 2
      UnitTests/Application/ApplicationTests.cs

+ 2 - 7
Terminal.Gui/Application/Application.cs

@@ -686,7 +686,7 @@ public static partial class Application
 
 
         var top = new T ();
         var top = new T ();
 
 
-        Run (top, errorHandler, driver);
+        Run (top, errorHandler);
 
 
         return top;
         return top;
     }
     }
@@ -729,12 +729,7 @@ public static partial class Application
     ///     RELEASE builds only: Handler for any unhandled exceptions (resumes when returns true,
     ///     RELEASE builds only: Handler for any unhandled exceptions (resumes when returns true,
     ///     rethrows when null).
     ///     rethrows when null).
     /// </param>
     /// </param>
-    /// <param name="driver">
-    ///     The <see cref="ConsoleDriver"/> to use. If not specified the default driver for the platform will
-    ///     be used ( <see cref="WindowsDriver"/>, <see cref="CursesDriver"/>, or <see cref="NetDriver"/>). Must be
-    ///     <see langword="null"/> if <see cref="Init"/> was called.
-    /// </param>
-    public static void Run (Toplevel view, Func<Exception, bool> errorHandler = null, ConsoleDriver driver = null)
+    public static void Run (Toplevel view, Func<Exception, bool> errorHandler = null)
     {
     {
         ArgumentNullException.ThrowIfNull (view);
         ArgumentNullException.ThrowIfNull (view);
 
 

+ 2 - 2
UnitTests/Application/ApplicationTests.cs

@@ -962,7 +962,7 @@ public class ApplicationTests
 
 
         Assert.Null (Application.Top);
         Assert.Null (Application.Top);
 
 
-        Assert.Throws<InvalidOperationException> (() => Application.Run (new (), null, driver));
+        Assert.Throws<InvalidOperationException> (() => Application.Run (new Toplevel ()));
 
 
         Application.Init (driver);
         Application.Init (driver);
         Application.Iteration += (s, e) =>
         Application.Iteration += (s, e) =>
@@ -970,7 +970,7 @@ public class ApplicationTests
                                      Assert.NotNull (Application.Top);
                                      Assert.NotNull (Application.Top);
                                      Application.RequestStop ();
                                      Application.RequestStop ();
                                  };
                                  };
-        Application.Run (new (), null, driver);
+        Application.Run (new Toplevel ());
 #if DEBUG_IDISPOSABLE
 #if DEBUG_IDISPOSABLE
         Assert.False (Application.Top.WasDisposed);
         Assert.False (Application.Top.WasDisposed);
         Exception exception = Record.Exception (Application.Shutdown);
         Exception exception = Record.Exception (Application.Shutdown);