|
|
@ -10,6 +10,7 @@ using System.Collections.Generic;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.Drawing.Drawing2D;
|
|
|
|
using System.Drawing.Drawing2D;
|
|
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
@ -194,6 +195,17 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
DataSelectedIndex = 0;
|
|
|
|
DataSelectedIndex = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
public DelegateCommand CleanDataCommand => new(() =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//清除临时文件
|
|
|
|
|
|
|
|
string temPath = Path.GetPathRoot(SavePath) + "temPath";
|
|
|
|
|
|
|
|
if (Directory.Exists(temPath))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Directory.Delete(temPath, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageBox.Show("清除成功!");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
public DelegateCommand SaveCommand => new(() =>
|
|
|
|
public DelegateCommand SaveCommand => new(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var item = NameSource[DataSelectedIndex];
|
|
|
|
var item = NameSource[DataSelectedIndex];
|
|
|
@ -232,7 +244,6 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DataPath = path;
|
|
|
|
DataPath = path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -255,13 +266,32 @@ namespace StartServerWPF.Modules.Main.ViewModels
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DateTime dateTime = StartSelectedDate;
|
|
|
|
DateTime dateTime = StartSelectedDate;
|
|
|
|
string temPath = Path.GetPathRoot(_workareaModel.savepath) + "temPath";
|
|
|
|
string temPath = Path.GetPathRoot(SavePath) + "temPath";
|
|
|
|
//清除临时文件
|
|
|
|
|
|
|
|
if (Directory.Exists(temPath))
|
|
|
|
if (!Directory.Exists(temPath))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Directory.CreateDirectory(temPath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ApmsEventSource.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Directory.Delete(temPath, true);
|
|
|
|
ApmsEventSource.Clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Directory.CreateDirectory(temPath);
|
|
|
|
var fileName = Directory.GetFiles(SavePath, "*.index", SearchOption.AllDirectories);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var file in fileName)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool flag= DateTime.TryParseExact(Path.GetFileNameWithoutExtension(file), "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture,
|
|
|
|
|
|
|
|
DateTimeStyles.None, out DateTime da);
|
|
|
|
|
|
|
|
if (flag && StartSelectedDate.Date <= da && EndSelectedDate.Date >= da)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (File.Exists(file))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
File.Delete(file);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IsBusy = false;
|
|
|
|
IsBusy = false;
|
|
|
|