Пример #1
0
        protected override void Notify()
        {
            int size = Queue.Count;

            if (Position + size >= Length)
            {
                return;
            }

            if (size <= NotifyLeftOver)
            {
                BufferEventArgs <T> e = new BufferEventArgs <T>(0, CountPerWrite, Filters);
                OnFillBuffer(e);

                for (int i = 0; e.ActualWrite > i; i++)
                {
                    Queue.Enqueue(e.Buffer[i]);
                }
            }
        }
Пример #2
0
        protected virtual void Notify()
        {
            int size = Queue.Count;

            if (Position + size >= Length)
            {
                return;
            }

            if (size <= _notify)
            {
                BufferEventArgs <T> e = new BufferEventArgs <T>(0, Capacity - size, Filters);
                FillBuffer?.Invoke(this, e);

                for (int i = 0; e.ActualWrite > i; i++)
                {
                    Queue.Enqueue(e.Buffer[i]);
                }
            }
        }
Пример #3
0
 private void Buffer_FillBuffer(object sender, BufferEventArgs <T> e)
 {
     FillBuffer(sender, e);
 }
Пример #4
0
 protected void OnFillBuffer(BufferEventArgs <T> e)
 {
     FillBuffer?.Invoke(this, e);
 }