public void OnCycle() { if (this.doCleanup) { ClearWired(); } else { if (this.requestingUpdates.Count > 0) { List <WiredCycle> toAdd = new List <WiredCycle>(); while (this.requestingUpdates.Count > 0) { WiredCycle handler = null; if (!this.requestingUpdates.TryDequeue(out handler)) { continue; } if (handler.IWiredCycleable.Disposed()) { continue; } if (handler.OnCycle()) { toAdd.Add(handler); } } foreach (WiredCycle cycle in toAdd) { this.requestingUpdates.Enqueue(cycle); } } this.WiredUsed.Clear(); } }
public void RequestCycle(WiredCycle handler) { this.requestingUpdates.Enqueue(handler); }