Base class for all the workers of a processing chain.
Inheritance: IDisposable
 public void RemoveLast()
 {
     if (workers.Count > 1)
         workers[workers.Count - 2].ReceiveData -= new ReceiveDataDelegate(workers[workers.Count - 1].ProcessData);
     if (workers.Count > 0)
     {
         workers.RemoveAt(workers.Count - 1);
         lastWorker = workers.Last();
     }
 }
 /// <summary>
 /// Adds the next Worker to the chain and register it to the previous Worker to the ReceiveData event.
 /// </summary>
 /// <param name="worker"></param>
 public void Add(Worker worker)
 {
     workers.Add(worker);
     if (firstWorker == null)
         firstWorker = worker;
     else
         lastWorker.ReceiveData += new ReceiveDataDelegate(worker.ProcessData);
     lastWorker = worker;
 }