throttle reimplemented

This commit is contained in:
Alex Bezdieniezhnykh
2025-04-17 09:16:34 +03:00
parent 0c66607ed7
commit 277aaf09b0
7 changed files with 109 additions and 51 deletions
+2 -2
View File
@@ -187,7 +187,7 @@ public partial class App
services.ConfigureSection<InferenceClientConfig>(context.Configuration);
services.ConfigureSection<GpsDeniedClientConfig>(context.Configuration);
services.AddSingleton<IInferenceClient, InferenceClient>();
services.AddSingleton<IInferenceClient>(_inferenceClient);
services.AddSingleton<IGpsMatcherClient, GpsMatcherClient>();
services.AddSingleton<IInferenceService, InferenceService>();
services.AddSingleton<IGpsMatcherService, GpsMatcherService>();
@@ -238,7 +238,7 @@ public partial class App
{
var args = (KeyEventArgs)e;
var keyEvent = new KeyEvent(sender, args, _formState.ActiveWindow);
_ = ThrottleExt.Throttle(() => _mediator.Publish(keyEvent), TimeSpan.FromMilliseconds(50));
ThrottleExt.Throttle(() => _mediator.Publish(keyEvent), KeyPressTaskId, TimeSpan.FromMilliseconds(50));
}
protected override async void OnExit(ExitEventArgs e)