Example #1
0
        internal void SwapCollectorEntries(CollectorEntry c1, CollectorEntry c2)
        {
            int index1 = Collectors.FindIndex(c => c.UniqueId == c1.UniqueId);
            int index2 = Collectors.FindIndex(c => c.UniqueId == c2.UniqueId);

            if (index1 < index2)
            {
                int tmp = index1;
                index1 = index2;
                index2 = tmp;
            }

            if (index1 > -1 && index2 > -1 && index1 != index2)
            {
                Collectors.RemoveAt(index1);
                Collectors.RemoveAt(index2);
                Collectors.Insert(index2, c1);
                Collectors.Insert(index1, c2);
            }
        }