SystemCache.cs
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Hh.Mes.POJO.Entity;
using System.Collections.Generic;
namespace Hh.Mes.Pojo.System
{
public class SystemCache
{
private static SystemCache _cache;
private static readonly object LockHelper = new object();
/// <summary> 内存缓存数据 SysModuleElement
/// </summary>
public List<SysModuleView> SysModuleViewCache;
/// <summary> 内存缓存数据 SysModuleElement
/// </summary>
public List<SysModuleElement> SysModuleElementCache;
private SystemCache()
{
SysModuleViewCache = new List<SysModuleView>(1);
SysModuleElementCache = new List<SysModuleElement>(1);
}
public static SystemCache GetInstance
{
get
{
if (_cache == null)
{
lock (LockHelper)
{
if (_cache == null)
{
_cache = new SystemCache();
}
}
}
return _cache;
}
}
/// <summary>
/// 清除缓存
/// </summary>
public void ClearSystemCache()
{
SysModuleViewCache = new List<SysModuleView>(1);
SysModuleElementCache = new List<SysModuleElement>(1);
}
}
}