71 lines
1.5 KiB
C#
71 lines
1.5 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 XgateCacheDAL
|
|
{
|
|
private static object lockobj = new object();
|
|
public static List<XGate> XgatesList = new List<XGate>();//
|
|
|
|
#region 获取Xgate列表
|
|
public List<XGate> 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
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|