public void RunActionCount(int actionCount) { int actionsProcessed = 0; bool continueProcessing = WorkQueue1.Count > 0; while (continueProcessing) { IJob <TKey> action = WorkQueue1.Dequeue(); ProcessAction(action); continueProcessing = WorkQueue1.Count > 0 || actionsProcessed == actionCount; } }
private void SolveUI() { while (Count > 0) { while (WorkQueue1.Count > 0) { IJob <TKey> jobCurrent = WorkQueue1.Dequeue(); ProcessAction(jobCurrent); } while (WorkQueue2.Count > 0) { IJob <TKey> jobCurrent = WorkQueue2.Dequeue(); ProcessAction(jobCurrent); } } }
public Keys <TKey> DoNextJob() { IJob <TKey> nextJob = null; Keys <TKey> keysChanged = new Keys <TKey>(); if (WorkQueue1.Count > 0) { nextJob = WorkQueue1.Dequeue(); } else if (WorkQueue2.Count > 0) { nextJob = WorkQueue2.Dequeue(); } if (nextJob != null) { keysChanged.UnionWith(nextJob.Process(this)); } return(keysChanged); }