Beispiel #1
0
        private List <AlarmCacheObject> PopAlarms()
        {
            List <AlarmCacheObject> cacheObjects = new List <AlarmCacheObject>();

            for (int i = 0; i < MaxReadNumber; i++)
            {
                AlarmCacheObject result = null;
                if (AlarmCache.TryPop(out result))
                {
                    if (!string.IsNullOrEmpty(result.DataString))
                    {
                        cacheObjects.Add(result);
                    }
                }
                else//如果没有则终止
                {
                    break;
                }
            }
            return(cacheObjects);
        }
Beispiel #2
0
 public void Push(AlarmCacheObject cacheObject)
 {
     AlarmCache.Push(cacheObject);
 }