添加项目文件。
This commit is contained in:
89
Epost.DAL/Cache/EPlightCacheDAL.cs
Normal file
89
Epost.DAL/Cache/EPlightCacheDAL.cs
Normal file
@ -0,0 +1,89 @@
|
||||
using ComposerSDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Epost.DAL.Cache
|
||||
{
|
||||
public class EPlightCacheDAL
|
||||
{
|
||||
private static object lockobj = new object();
|
||||
public static List<XGate> XgatesList = new List<XGate>();//
|
||||
|
||||
#region 获取EPlight列表
|
||||
//public List<E> GetXgateList()
|
||||
//{
|
||||
|
||||
// return XgatesList;
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#region 初始Xgate列表
|
||||
public void ClearXgateList()
|
||||
{
|
||||
foreach (var item in XgatesList.ToArray())
|
||||
{
|
||||
XgatesList.Remove(item);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region xgate缓存处理方法
|
||||
/// <summary>
|
||||
/// xgate缓存处理方法
|
||||
/// </summary>
|
||||
/// <param name="JobParam"></param>
|
||||
/// <param name="EXgateCommend"></param>
|
||||
/// <returns></returns>
|
||||
public bool UpdateXgatesList(List<XGate> JobParam, EXgateCommend CommendType)
|
||||
{
|
||||
|
||||
lock (lockobj)
|
||||
{
|
||||
|
||||
if (CommendType.Equals(EXgateCommend.Create))
|
||||
{
|
||||
XgatesList.AddRange(JobParam);
|
||||
}
|
||||
|
||||
else if (CommendType.Equals(EXgateCommend.Execute))
|
||||
{
|
||||
JobParam.ForEach(m => XgatesList.Remove(m));
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public enum EXgateCommend
|
||||
{
|
||||
/// <summary>
|
||||
/// Xgate创建
|
||||
/// </summary>
|
||||
[Description("Xgate创建")]
|
||||
Create,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Xgate清除
|
||||
/// </summary>
|
||||
[Description("Xgate清除")]
|
||||
Execute
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user