mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 23:06:31 +00:00
refactor external clients
put model batch size as parameter in config
This commit is contained in:
@@ -25,6 +25,7 @@ public partial class MainSuite
|
||||
private readonly IDbFactory _dbFactory;
|
||||
private readonly Dictionary<WindowEnum, Window> _openedWindows = new();
|
||||
private readonly IResourceLoader _resourceLoader;
|
||||
private readonly IEnumerable<IExternalClient> _externalClients;
|
||||
private static readonly Guid SaveConfigTaskId = Guid.NewGuid();
|
||||
|
||||
public MainSuite(IOptions<AppConfig> appConfig,
|
||||
@@ -33,7 +34,8 @@ public partial class MainSuite
|
||||
IServiceProvider sp,
|
||||
IGalleryService galleryService,
|
||||
IDbFactory dbFactory,
|
||||
IResourceLoader resourceLoader)
|
||||
IResourceLoader resourceLoader,
|
||||
IEnumerable<IExternalClient> externalClients)
|
||||
{
|
||||
_configUpdater = configUpdater;
|
||||
_modules = modules;
|
||||
@@ -41,6 +43,7 @@ public partial class MainSuite
|
||||
_galleryService = galleryService;
|
||||
_dbFactory = dbFactory;
|
||||
_resourceLoader = resourceLoader;
|
||||
_externalClients = externalClients;
|
||||
_appConfig = appConfig.Value;
|
||||
InitializeComponent();
|
||||
Loaded += OnLoaded;
|
||||
@@ -111,10 +114,13 @@ public partial class MainSuite
|
||||
_openedWindows[module.WindowEnum] = window;
|
||||
window.Closed += (_, _) =>
|
||||
{
|
||||
_resourceLoader.StopPython();
|
||||
_openedWindows.Remove(module.WindowEnum);
|
||||
if (!_openedWindows.Any())
|
||||
Close();
|
||||
if (_openedWindows.Any())
|
||||
return;
|
||||
|
||||
foreach (var client in _externalClients)
|
||||
client.Stop();
|
||||
Close();
|
||||
};
|
||||
window.Show();
|
||||
window.Activate();
|
||||
|
||||
Reference in New Issue
Block a user