void IMessagesRangeHost.DisposeRange(MessagesRange range) { if (range == null) { throw new ArgumentNullException("range"); } if (openRange == null) { throw new InvalidOperationException("There has been no ranges opened. Nothing to dispose."); } if (range != openRange.Value) { throw new ArgumentException("Attempt to dispose the range that was not open."); } CheckIntegrity(); if (range.IsComplete) { if (openRange.Next != null) { openRange.Value.AppendToEnd(openRange.Next.Value); ranges.Remove(openRange.Next); } } openRange = null; CheckIntegrity(); }
public void InvalidateMessages() { if (openRange != null) { throw new InvalidOperationException("Cannot invalidate the messages when there is a subrange being filled"); } if (ranges.Count == 0) { return; } MessagesRange r = new MessagesRange(ActiveRange); ranges.Clear(); ranges.AddLast(r); }
public void AppendToEnd(MessagesRange r) { CheckNotOpen(); if (!this.IsComplete) { Debug.Assert(r.IsEmpty); } if (this.IsComplete) { this.isComplete = r.isComplete; } this.desirableRange = new FRange( this.desirableRange.Begin, r.desirableRange.End, r.desirableRange.Priority); Add(r.first, r.last); }