public static void OnInserted(IDistanceCounterCollection distances, ILineSizeHost linesHost, int insertAt, int count)
        {
            distances.Insert(insertAt, count);
            int to = insertAt + count - 1;
            int repeatSizeCount;

            // Set line sizes
            for (int index = insertAt; index <= to; index++)
            {
                double size = linesHost.GetSize(index, out repeatSizeCount);
                if (size != distances.DefaultDistance)
                {
                    int rangeTo = GetRangeToHelper(index, to, repeatSizeCount);
                    distances.SetRange(index, rangeTo, size);
                    index = rangeTo;
                }
            }

            // Also check for hidden rows and reset line sizes for them.
            for (int index = insertAt; index <= to; index++)
            {
                bool hide = linesHost.GetHidden(index, out repeatSizeCount);
                if (hide)
                {
                    int rangeTo = GetRangeToHelper(index, to, repeatSizeCount);
                    distances.SetRange(index, rangeTo, 0.0);
                    index = rangeTo;
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// Insert entities in the collection.
 /// </summary>
 /// <param name="insertAt">Insert position.</param>
 /// <param name="count">The number of entities to be inserted.</param>
 public void Insert(int insertAt, int count)
 {
     trackDCC.Insert(insertAt + start, count);
 }