/// <summary> /// Sets the state of the window. /// </summary> /// <param name="state">The state.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public virtual bool SetWindowState(IWindowState state) { lock (dbLock) { Database.WindowState = Mapper.Map <IWindowState>(state); return(true); } }
private void EnterState(IWindowState newState, Duration remainingTime) { if (newState != currentState) { currentState = newState; currentState.Apply(window, remainingTime); } }
/// <summary> /// Sets the state of the window. /// </summary> /// <param name="state">The state.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public virtual bool SetWindowState(IWindowState state) { lock (dbLock) { var data = Mapper.Map <IWindowState>(state); if (IsDifferent(data, Database.WindowState)) { Database.WindowState = data; } return(true); } }
public WindowStateManager(Form form, IWindowState windowStateStore) { if (form == null) { throw new ArgumentNullException(nameof(form)); } this.form = form; if (windowStateStore == null) { throw new ArgumentNullException(nameof(windowStateStore)); } this.windowStateStore = windowStateStore; AddEventHandlers(); }
public TimerWindowPresenter(IPomodoroEngine pomodoroEngine, ICountdownClock countdownClock, IEventHub eventHub) { this.countdownClock = countdownClock; idleState = new IdleState(pomodoroEngine); pomodoroState = new PomodoroState(pomodoroEngine); shortBreakState = new ShortBreakState(pomodoroEngine); longBreakState = new LongBreakState(pomodoroEngine); pomodoroCompletedState = new PomodoroCompletedState(pomodoroEngine); breakFinishedState = new BreakFinishedState(pomodoroEngine); pomodoroInterruptedState = new TimerInterruptedState("Pomodoro Interrupted", pomodoroEngine); breakInterruptedState = new TimerInterruptedState("Break Interrupted", pomodoroEngine); currentState = idleState; eventHub.Subscribe <TimerStarted>(OnTimerStarted); eventHub.Subscribe <TimeElapsed>(OnTimeElapsed); eventHub.Subscribe <TimerStopped>(OnTimerStopped); }
public WindowContext(IWindowState windowState) { WindowState = windowState; }
private void ActiveWindowState_WindowStateChanged(WindowStateChangedEventArgs args) { activeWindowState = args.NewWindowState; activeWindowState.Initialize(); activeWindowState.WindowStateChanged += ActiveWindowState_WindowStateChanged; }
public WindowManager(TextRenderer textRenderer) { activeWindowState = new EmulatorSelectionWindowState(textRenderer); activeWindowState.WindowStateChanged += ActiveWindowState_WindowStateChanged; }
/// <summary> /// Saves the specified state. /// </summary> /// <param name="state">The state.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public virtual bool Save(IWindowState state) { return(StorageProvider.SetWindowState(state)); }