105040 Update 窗口打开时重新加载缓存数据
This commit is contained in:
parent
7bc9c84af3
commit
82a9f67d8c
|
@ -139,8 +139,13 @@ public partial class MainWindow : Window
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
LoadingMask.Visibility = Visibility.Visible;
|
LoadingMask.Visibility = Visibility.Visible;
|
||||||
|
this.Dispatcher.BeginInvoke(async delegate ()
|
||||||
|
{
|
||||||
|
ExcelHelper.CheckAndGetCache(true);
|
||||||
await LoadDataAsync(datas, reportColumns);
|
await LoadDataAsync(datas, reportColumns);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (System.Exception ex)
|
catch (System.Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,11 +26,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||||
CheckAndGetCache();
|
CheckAndGetCache();
|
||||||
return _terminalMappingCache.Where(item => item.WireModelSpecification == wireModel && (item.Prefix == prefix || item.Prefix == null));
|
return _terminalMappingCache.Where(item => item.WireModelSpecification == wireModel && (item.Prefix == prefix || item.Prefix == null));
|
||||||
}
|
}
|
||||||
private static void CheckAndGetCache()
|
public static void CheckAndGetCache(bool isForceReload = false)
|
||||||
{
|
{
|
||||||
lock (_terminalMappingCache)
|
lock (_terminalMappingCache)
|
||||||
{
|
{
|
||||||
if (_terminalMappingCache == null || !_terminalMappingCache.Any())
|
if ((_terminalMappingCache == null || !_terminalMappingCache.Any()) || isForceReload)
|
||||||
{
|
{
|
||||||
GetAllWireTerminalMappingTable();
|
GetAllWireTerminalMappingTable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue