Пример #1
0
        } //Push

        public void Update(BasePriorityKey currentPriority)
        {
            if (base.Count == 0)
            {
                return;
            }

            for (int index = 0; index < base.Keys.Count; index++)
            {
                if (base.Keys[index].IsExpired(currentPriority))
                {
                    base[base.Keys[index]].Run();
                    this.mToRemove.Add(base.Keys[index]);
                }
                else
                {
                    break; //no reason to continue if the item is not expired yet.
                }
            } //next index

            if (this.mToRemove.Count > 0)
            {
                for (int index = (this.mToRemove.Count - 1); index >= 0; index--)
                {
                    base.Remove(this.mToRemove[index]);
                } //next index
            }
        }         //Update
Пример #2
0
 public void Push(BasePriorityKey key, BaseEvent evnt)
 {
     base.Add(new PriorityKey(key), evnt);
 } //Push
Пример #3
0
 public bool IsExpired(BasePriorityKey key)
 {
     return(key.CompareTo(this.Key) >= 0);
 }
Пример #4
0
 public PriorityKey(BasePriorityKey key)
 {
     this.Key = key;
 }