Explorar el Código

typo and fix FakeDriver

tznind hace 11 meses
padre
commit
92648e5a48

+ 5 - 5
Terminal.Gui/ConsoleDrivers/AnsiResponseParser.cs

@@ -8,7 +8,7 @@ namespace Terminal.Gui;
 public class AnsiRequestScheduler(IAnsiResponseParser parser)
 {
     public static int sent = 0;
-    public List<AnsiEscapeSequenceRequest> Requsts = new  ();
+    public List<AnsiEscapeSequenceRequest> Requests = new  ();
 
     private ConcurrentDictionary<string, DateTime> _lastSend = new ();
 
@@ -30,25 +30,25 @@ public class AnsiRequestScheduler(IAnsiResponseParser parser)
         }
         else
         {
-            Requsts.Add (request);
+            Requests.Add (request);
             return false;
         }
     }
 
 
     /// <summary>
-    /// Identifies and runs any <see cref="Requsts"/> that can be sent based on the
+    /// Identifies and runs any <see cref="Requests"/> that can be sent based on the
     /// current outstanding requests of the parser.
     /// </summary>
     /// <returns><see langword="true"/> if a request was found and run. <see langword="false"/>
     /// if no outstanding requests or all have existing outstanding requests underway in parser.</returns>
     public bool RunSchedule ()
     {
-        var opportunity = Requsts.FirstOrDefault (CanSend);
+        var opportunity = Requests.FirstOrDefault (CanSend);
 
         if (opportunity != null)
         {
-            Requsts.Remove (opportunity);
+            Requests.Remove (opportunity);
             Send (opportunity);
 
             return true;

+ 2 - 10
Terminal.Gui/ConsoleDrivers/ConsoleDriver.cs

@@ -611,18 +611,10 @@ public abstract class ConsoleDriver : IConsoleDriver
     #endregion
 
     /// <inheritdoc />
-    public virtual IAnsiResponseParser GetParser ()
-    {
-        // TODO: implement in other drivers
-        throw new NotSupportedException ();
-    }
+    public abstract IAnsiResponseParser GetParser ();
 
     /// <inheritdoc />
-    public virtual void RawWrite (string str)
-    {
-        // TODO: implement in other drivers
-        throw new NotSupportedException ();
-    }
+    public abstract void RawWrite (string str);
 }
 
 /// <summary>

+ 8 - 0
Terminal.Gui/ConsoleDrivers/FakeDriver/FakeDriver.cs

@@ -392,6 +392,14 @@ public class FakeDriver : ConsoleDriver
         MockKeyPressedHandler (new ConsoleKeyInfo (keyChar, key, shift, alt, control));
     }
 
+    private AnsiResponseParser _parser = new ();
+
+    /// <inheritdoc />
+    public override IAnsiResponseParser GetParser () => _parser;
+
+    /// <inheritdoc />
+    public override void RawWrite (string str) { throw new NotImplementedException (); }
+
     public void SetBufferSize (int width, int height)
     {
         FakeConsole.SetBufferSize (width, height);