90 lines
1.8 KiB
C#
90 lines
1.8 KiB
C#
![]() |
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
|
|||
|
}
|
|||
|
}
|