Exemplo n.º 1
0
 private void Remove(ConnectedSlotInformation info)
 {
     if (_knownSlots.ContainsKey(info.Slot))
     {
         _connectedSlotInformation.Remove(info);
         _knownSlots.Remove(info.Slot);
     }
 }
Exemplo n.º 2
0
 private int Sort(ConnectedSlotInformation x, ConnectedSlotInformation y)
 {
     if (x.Priority == y.Priority)
     {
         return(x.AddedAtIndex < y.AddedAtIndex ? -1 : 1);
     }
     if (x.Priority > y.Priority)
     {
         return(-1);
     }
     return(1);
 }
Exemplo n.º 3
0
        protected void AddInternal(Slot slot, int priority, bool once)
        {
            if (!_knownSlots.ContainsKey(slot))
            {
                var info = new ConnectedSlotInformation(slot, priority, once, _indexCounter++);
                _connectedSlotInformation.Add(info);
                _knownSlots.Add(slot, info);

                // sort
                _connectedSlotInformation.Sort(Sort);
            }
        }