Ejemplo n.º 1
0
        public void RemvoveEvent(ClockEvent eventClock)
        {
            object clockLock = this.clockLock;

            lock (clockLock)
            {
                if (this.eventList.Contains(eventClock))
                {
                    int index = this.eventList.FindIndex(tmpEvent => tmpEvent == eventClock);
                    if (index > -1)
                    {
                        this.eventList.RemoveAt(index);
                        this.eventTimeList.RemoveAt(index);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void AddNewEvent(ClockEvent eventClock)
        {
            object clockLock = this.clockLock;

            lock (clockLock)
            {
                int insertInTimeListIndex = this.GetInsertInTimeListIndex(eventClock.DelayTime + this.clockSecond);
                if (insertInTimeListIndex > -1)
                {
                    this.eventList.Insert(insertInTimeListIndex, eventClock);
                }
                else
                {
                    this.eventList.Add(eventClock);
                }
                this.specialCount++;
            }
        }