public void ChangeBufferSize(int newBufferSize) { lock (this) { CyclicBuffer <LogEvent> newEvents = new CyclicBuffer <LogEvent>(newBufferSize); newEvents.CopyTo(newEvents); //if (newBufferSize > _bufferedEvents = newEvents; } }
public void CopyTo(CyclicBuffer <T> destination) { int toCopy = Math.Min(Count, destination.Capacity); int startPos = Count - 1 - toCopy; for (int i = startPos; i < Count; ++i) { destination.AddAndRemoveLast(this[i]); } }
public void Resolve() { if (Columns.Count == 0) { Columns.Add(new LogColumn("ID", 120)); Columns.Add(new LogColumn("Received Time", 120, true)); } // initialize the ordinals for (int i = 0; i < Columns.Count; ++i) { Columns[i].Ordinal = i; } _columnOrdinalID = GetOrAllocateOrdinal("ID"); _columnOrdinalReceivedDate = GetOrAllocateOrdinal("Received Time"); _columnOrdinalLevel = GetOrAllocateOrdinal("Level"); _bufferedEvents = new CyclicBuffer <LogEvent>(MaxLogEntries); NewSortOrder(); Receiver.Connect(this); }