2023-02-15 22:17:19 +00:00
|
|
|
|
using System;
|
2023-02-16 09:25:33 +00:00
|
|
|
|
using System.Collections.Generic;
|
2023-02-16 23:54:23 +00:00
|
|
|
|
using Microsoft.Extensions.Logging;
|
2023-02-16 09:25:33 +00:00
|
|
|
|
using Pal.Client.Configuration;
|
|
|
|
|
using Pal.Client.DependencyInjection;
|
2023-02-18 20:12:36 +00:00
|
|
|
|
using Pal.Client.Floors;
|
2023-02-16 18:51:54 +00:00
|
|
|
|
using Pal.Client.Windows;
|
2023-02-16 09:25:33 +00:00
|
|
|
|
using Pal.Common;
|
2022-12-24 09:27:59 +00:00
|
|
|
|
|
|
|
|
|
namespace Pal.Client.Scheduled
|
|
|
|
|
{
|
2023-02-15 22:17:19 +00:00
|
|
|
|
internal sealed class QueuedUndoImport : IQueueOnFrameworkThread
|
2022-12-24 09:27:59 +00:00
|
|
|
|
{
|
|
|
|
|
public QueuedUndoImport(Guid exportId)
|
|
|
|
|
{
|
2023-02-15 22:17:19 +00:00
|
|
|
|
ExportId = exportId;
|
2022-12-24 09:27:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-02-16 09:25:33 +00:00
|
|
|
|
private Guid ExportId { get; }
|
|
|
|
|
|
|
|
|
|
internal sealed class Handler : IQueueOnFrameworkThread.Handler<QueuedUndoImport>
|
|
|
|
|
{
|
2023-02-16 18:51:54 +00:00
|
|
|
|
private readonly ImportService _importService;
|
|
|
|
|
private readonly ConfigWindow _configWindow;
|
2023-02-16 09:25:33 +00:00
|
|
|
|
|
2023-02-18 20:12:36 +00:00
|
|
|
|
public Handler(ILogger<Handler> logger, ImportService importService, ConfigWindow configWindow)
|
2023-02-16 23:54:23 +00:00
|
|
|
|
: base(logger)
|
2023-02-16 09:25:33 +00:00
|
|
|
|
{
|
2023-02-16 18:51:54 +00:00
|
|
|
|
_importService = importService;
|
|
|
|
|
_configWindow = configWindow;
|
2023-02-16 09:25:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-02-18 20:12:36 +00:00
|
|
|
|
protected override void Run(QueuedUndoImport queued, ref bool recreateLayout)
|
2023-02-16 09:25:33 +00:00
|
|
|
|
{
|
|
|
|
|
recreateLayout = true;
|
|
|
|
|
|
2023-02-16 18:51:54 +00:00
|
|
|
|
_importService.RemoveById(queued.ExportId);
|
|
|
|
|
_configWindow.UpdateLastImport();
|
2023-02-16 09:25:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-24 09:27:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|