40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
namespace Common.UI.ViewModels
|
|
{
|
|
using Common.Hardware.WaterMeter.eRegister.Models;
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
internal class EregisterFinalizeVM : EregisterInitializeVM
|
|
{
|
|
protected override async Task StartProgrammingAsync(EregisterProgrammingParametersList parametersList)
|
|
{
|
|
var programmingTasksEnumerable = this.eregisterFactory.LoadInspectionFinalizationTasks(parametersList);
|
|
|
|
this.LoadUIComponenets(programmingTasksEnumerable);
|
|
|
|
await Task.Delay(3000);
|
|
|
|
this.TimeElapsed = null;
|
|
this.timestamp = DateTime.Now;
|
|
this.timer.Start();
|
|
this.programmingTask = this.eregisterFactory
|
|
.StartProgrammingAsync(this.cancellationToken)
|
|
.ContinueWith(_ =>
|
|
{
|
|
this.timer.Stop();
|
|
|
|
this.StartEnabled = true;
|
|
this.StopEnabled = false;
|
|
})
|
|
.ContinueWith(async _ =>
|
|
{
|
|
await Task.Delay(1_000);
|
|
|
|
this.sirtFactory.CloseConnections();
|
|
// this.InvokeAsync(App.Current.Shutdown);
|
|
});
|
|
}
|
|
}
|
|
}
|