public TimerPause(LiveSplitState state) { Settings = new TimerPauseSettings(); PauseTime = TimeStamp.Now; var timerModel = new TimerModel(); timerModel.CurrentState = state; Model = timerModel; state.OnPause += state_OnPause; CurrentState = state; }
private void state_OnPause(object sender, EventArgs e) { PauseTime = TimeStamp.Now; }
public SlideshowComponent(IComponent component) { Component = component; LastDequeue = TimeStamp.Now; }
private void possiblySwapOutComponent(IInvalidator invalidator, float width, float height) { if (queuedComponents.Count > 1 && (TimeStamp.Now - (lastSwap ?? TimeStamp.Now) > TimeSpan.FromSeconds(8) || TimeStamp.Now - (lastInvalidation ?? TimeStamp.Now) > TimeSpan.FromSeconds(3))) { lastSwap = TimeStamp.Now; var dequeuedComponent = queuedComponents.Dequeue(); var slideshowComponent = slideshowComponents.FirstOrDefault(x => x.Component == dequeuedComponent); if (slideshowComponent != null) { slideshowComponent.LastDequeue = lastSwap; } if (invalidator != null) { lastInvalidation = TimeStamp.Now; invalidator.Invalidate(0, 0, width, height); } } }
private void enqueueComponent(IComponent currentComponent) { if (!queuedComponents.Contains(currentComponent)) { System.Diagnostics.Debug.WriteLine($"Enqueue { currentComponent.ComponentName }"); if (!queuedComponents.Any()) lastSwap = TimeStamp.Now; queuedComponents.Enqueue(currentComponent); } }
private void invalidateComponent(IInvalidator invalidator, float x, float y, float w, float h, IComponent currentComponent) { if (currentComponent != null) { enqueueComponent(currentComponent); if (invalidator != null && queuedComponents.FirstOrDefault() == currentComponent) { lastInvalidation = TimeStamp.Now; invalidator.Invalidate(x, y, w, h); } } }
public DoubleTapPrevention(ITimerModel model) { InternalModel = model; LastEvent = TimeStamp.Now - LongDelay; }