Beispiel #1
0
 protected void ThreadMain()
 {
     while (IsRunning)
     {
         if (!IsPaused)
         {
             Tuple <IOutput, IInput> flow = null;
             if (Flows.TryDequeue(out flow))
             {
                 IMessage item = null;
                 Type     t    = flow.Item1.GetType();
                 item = flow.Item1.PopIMessage();
                 if (item != null)
                 {
                     flow.Item2.PushIMessage(item);
                 }
                 Flows.Enqueue(flow);
             }
             if (Delegated != null)
             {
                 Delegated.DynamicInvoke(DelegateParameters);
             }
         }
         Thread.Sleep(Interval);
     }
 }
Beispiel #2
0
 public virtual void AddFlow(IOutput item1, IInput item2)
 {
     Flows.Enqueue(new Tuple <IOutput, IInput>(item1, item2));
 }