public static void DistancesLineHiddenChanged(IDistanceCounterCollection distances, ILineSizeHost linesHost, int from, int to) { var ndh = linesHost as INestedDistancesHost; for (int n = from; n <= to; n++) { int repeatSizeCount; bool hide = linesHost.GetHidden(n, out repeatSizeCount); if (ndh == null || ndh.GetDistances(n) == null) { int rangeTo = GetRangeToHelper(n, to, repeatSizeCount); if (hide) { distances.SetRange(n, rangeTo, 0.0); } else { DistancesLineSizeChanged(distances, linesHost, n, rangeTo); } n = rangeTo; } else { distances.SetNestedDistances(n, hide ? null : ndh.GetDistances(n)); } } }
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; } } }