public void EnqueueCacheItem(KuaFuEventTypes eventType, params object[] args) { lock (CacheItemQueue) { AsyncDataItem item = new AsyncDataItem() { EventType = eventType, Args = args }; int count = CacheItemQueue.Count; if (count > MaxCachedAsyncDataItemCount) { for (count -= MaxCachedAsyncDataItemCount; count >= 0; count--) { CacheItemQueue.Dequeue(); } } CacheItemQueue.Enqueue(item); } }
public AsyncDataItem(KuaFuEventTypes eventType, params object[] args) { EventType = eventType; Args = args; }