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); } }
protected void ThreadMain() { while (IsRunning) { if (!IsPaused) { Delegated.DynamicInvoke(DelegateParameters); } Thread.Sleep(RunDelay); } }