/// <summary> /// Sets the line size for a range. /// </summary> /// <param name="from">From.</param> /// <param name="to">To.</param> /// <param name="size">The size.</param> public void SetRange(int from, int to, double size) { /*if (lineNested.Count > 0) * { * for (int n = from; n <= to; n++) * { * if (lineNested.ContainsKey(n)) * throw new InvalidOperationException("Cannot change size of a nested LineSizeCollection."); * } * }*/ int count; double savevalue = GetRange(from, out count); lineSizes.SetRange(from, to - from + 1, size); if (IsSuspendUpdates) { return; } // DistancesLineHiddenChanged checks both hidden state and sizes together ... if (distances != null) { DistancesUtil.DistancesLineHiddenChanged(distances, this, from, to); } if (LineSizeChanged != null) { LineSizeChanged(this, new RangeChangedEventArgs(from, to, savevalue, size)); } }
/// <summary> /// Sets the hidden state for a range of lines. /// </summary> /// <param name="from">From.</param> /// <param name="to">To.</param> /// <param name="hide">if set to <c>true</c> hide the lines.</param> public void SetHidden(int from, int to, bool hide) { lineHidden.SetRange(from, to - from + 1, hide); if (IsSuspendUpdates) { return; } // DistancesLineHiddenChanged checks both hidden state and sizes together ... if (distances != null) { DistancesUtil.DistancesLineHiddenChanged(distances, this, from, to); } if (LineHiddenChanged != null) { LineHiddenChanged(this, new HiddenRangeChangedEventArgs(from, to, hide)); } }