protected virtual void Dispose(bool disposing)
 {
     if (!disposing)
     {
         return;
     }
     if (Background == null)
     {
         return;
     }
     Background.Dispose();
     Background = null;
 }
 protected UsesBackgroundProducer()
 {
     Background = new BackgroundProducer <T>();
 }
 public static BackgroundProducer <T> Consumes <T>(this BackgroundProducer <T> producer, IProducerConsumerCollection <T> collection)
 {
     producer.Attach(new CollectionConsumer <T>(collection));
     return(producer);
 }
 public static BackgroundProducer <T> Consumes <T>(this BackgroundProducer <T> producer, IEnumerable <Consumes <T> > consumers)
 {
     producer.Attach(new CompositeConsumer <T>(consumers));
     return(producer);
 }
 public static BackgroundProducer <T> Consumes <T>(this BackgroundProducer <T> producer, Action <T> @delegate, Consumes <T> forwardTo)
 {
     producer.Attach(new DelegatingConsumer <T>(@delegate, forwardTo));
     return(producer);
 }
 public static BackgroundProducer <T> Consumes <T>(this BackgroundProducer <T> producer, Consumes <T> consumer)
 {
     producer.Attach(consumer);
     return(producer);
 }