Exemplo n.º 1
0
 /// <summary>
 /// Flushes data through this filter and all its children.
 /// </summary>
 public virtual void Flush()
 {
     if (this.ChildFilter != null)
     {
         this.ChildFilter.Flush();
         while (ChildFilter.DataReady)
         {
             T data = ChildFilter.Read();
             lock (dataOut)
             {
                 dataOut.Enqueue(data);
             }
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Writes data to the filter. If there are child filters, the data will automaticaly
 /// flow through them before being placed in the output of the filter.
 /// </summary>
 /// <param name="Data">A data value to be passed through the filter</param>
 public virtual void Write(T Data)
 {
     if (ChildFilter != null)
     {
         ChildFilter.Write(Data);
         while (ChildFilter.DataReady)
         {
             T data = ChildFilter.Read();
             lock (dataOut)
             {
                 dataOut.Enqueue(data);
             }
         }
     }
     else
     {
         lock (dataOut)
         {
             dataOut.Enqueue(Data);
         }
     }
 }