Exemplo n.º 1
0
 public void ChangeBufferSize(int newBufferSize)
 {
     lock (this)
     {
         CyclicBuffer <LogEvent> newEvents = new CyclicBuffer <LogEvent>(newBufferSize);
         newEvents.CopyTo(newEvents);
         //if (newBufferSize >
         _bufferedEvents = newEvents;
     }
 }
Exemplo n.º 2
0
        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]);
            }
        }
Exemplo n.º 3
0
        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);
        }