protected override void OnSectionRemoved(int totalCount) { lock (_syncRoot) { _buffer.RemoveRange(totalCount, _buffer.Count - totalCount); } }
/// <summary> /// Removes everything from the given index onwards until the end. /// </summary> /// <param name="index"></param> public void RemoveFrom(LogLineIndex index) { lock (_syncRoot) { if (index < 0) { Log.WarnFormat("Invalid index '{0}'", index); return; } if (index > _logBuffer.Count) { Log.WarnFormat("Invalid index '{0}', Count is '{1}'", index, _logBuffer.Count); return; } var available = _logBuffer.Count - index; _logBuffer.RemoveRange((int)index, available); SetValue(Core.Properties.LogEntryCount, _logBuffer.Count); _listeners.Remove((int)index, available); Touch(); } }