private void OnItemDiscarded(T discard, T value)
 {
     if (ItemDiscarded != null)
     {
         var args = new ItemDiscardedEventArgs <T>(discard, value);
         ItemDiscarded(this, args);
     }
 }
Пример #2
0
 // Method for implementation "what item is being discarded"?
 private static void QueueWithEventOnItemDiscarded(object sender, ItemDiscardedEventArgs <double> e)
 {
     Console.WriteLine("Buffer Full. Discarding {0}, new Item is {1}", e.ITemDiscarded, e.NewItem);
 }
 private void ItemDiscarded(object sender, ItemDiscardedEventArgs <double> e)
 {
     Console.WriteLine($"Buffer full. Discarding {e.ItemDiscarded}, New item is {e.NewItem}.");
 }