添加简单的同步状态
parent
d77b88f127
commit
8ee51b1acf
|
|
@ -22,7 +22,7 @@ public class SyncViewModel : MvcViewModelBase
|
||||||
public CustomCommand ComboBox_SelectionChanged { get; set; }
|
public CustomCommand ComboBox_SelectionChanged { get; set; }
|
||||||
public CustomCommand OpenTargetDirCommand { get; set; }
|
public CustomCommand OpenTargetDirCommand { get; set; }
|
||||||
|
|
||||||
public string SyncProgressText { get; set; }
|
|
||||||
|
|
||||||
protected override void Init()
|
protected override void Init()
|
||||||
{
|
{
|
||||||
|
|
@ -30,7 +30,7 @@ public class SyncViewModel : MvcViewModelBase
|
||||||
|
|
||||||
public SyncViewModel(ISerializerService serializerService, MinioService minioService)
|
public SyncViewModel(ISerializerService serializerService, MinioService minioService)
|
||||||
{
|
{
|
||||||
SyncProgressText = "已同步/待同步 0/0";
|
_syncProgressText = "";
|
||||||
Console.WriteLine("SyncViewModel");
|
Console.WriteLine("SyncViewModel");
|
||||||
_minioService = minioService;
|
_minioService = minioService;
|
||||||
_serializerService = serializerService;
|
_serializerService = serializerService;
|
||||||
|
|
@ -62,7 +62,9 @@ public class SyncViewModel : MvcViewModelBase
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
SyncProgressText = "同步中...";
|
||||||
await Task.Run(() => _minioService.MirrorAsync(_minioService._bucketName, SyncDir, _taskCount));
|
await Task.Run(() => _minioService.MirrorAsync(_minioService._bucketName, SyncDir, _taskCount));
|
||||||
|
SyncProgressText = "同步完成";
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -76,6 +78,18 @@ public class SyncViewModel : MvcViewModelBase
|
||||||
Console.WriteLine("Loaded");
|
Console.WriteLine("Loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _syncProgressText;
|
||||||
|
|
||||||
|
public string SyncProgressText
|
||||||
|
{
|
||||||
|
get => _syncProgressText;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_syncProgressText = value;
|
||||||
|
RaisePropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private int _taskCount = 3;
|
private int _taskCount = 3;
|
||||||
|
|
||||||
public int TaskCount
|
public int TaskCount
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue