Files
T-DAS/Epost.DAL/Cache/XgateCacheDAL.cs

71 lines
1.5 KiB
C#
Raw Normal View History

2023-01-13 15:30:20 +08:00
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
}
}