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)); } } }
private void InitializeDistances() { distances.Clear(); distances.Count = GetLineCount(); distances.DefaultDistance = DefaultLineSize; foreach (KeyValuePair <int, LineSizeCollection> entry in lineNested) { int repeatSizeCount; bool hide = GetHidden(entry.Key, out repeatSizeCount); if (hide) { distances.SetNestedDistances(entry.Key, null); } else { distances.SetNestedDistances(entry.Key, entry.Value.Distances); } } foreach (RangeValuePair <double> entry in lineSizes) { if (entry.Value != -2) { distances.SetRange(entry.Start, entry.End, entry.Value < 0 ? DefaultLineSize : entry.Value); } } foreach (RangeValuePair <bool> entry in lineHidden) { if (entry.Value) { distances.SetRange(entry.Start, entry.End, 0); } } }
public static void DistancesLineSizeChanged(IDistanceCounterCollection distances, ILineSizeHost linesHost, int from, int to) { var ndh = linesHost as INestedDistancesHost; for (int n = from; n <= to; n++) { if (ndh == null || ndh.GetDistances(n) == null) { int repeatSizeCount; double size = linesHost.GetSize(n, out repeatSizeCount); int rangeTo = GetRangeToHelper(n, to, repeatSizeCount); distances.SetRange(n, rangeTo, size); n = rangeTo; } else { distances.SetNestedDistances(n, ndh.GetDistances(n)); } } }
/// <summary> /// Assigns a collection with nested entities to an item. /// </summary> /// <param name="index">The index.</param> /// <param name="nestedCollection">The nested collection.</param> public void SetNestedDistances(int index, IDistanceCounterCollection nestedCollection) { trackDCC.SetNestedDistances(index + start, nestedCollection); }