Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
 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);
     }
 }
Exemple #4
0
        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 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();
        }
Exemple #6
0
        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;
 }
Exemple #8
0
 private void ActiveWindowState_WindowStateChanged(WindowStateChangedEventArgs args)
 {
     activeWindowState = args.NewWindowState;
     activeWindowState.Initialize();
     activeWindowState.WindowStateChanged += ActiveWindowState_WindowStateChanged;
 }
Exemple #9
0
 public WindowManager(TextRenderer textRenderer)
 {
     activeWindowState = new EmulatorSelectionWindowState(textRenderer);
     activeWindowState.WindowStateChanged += ActiveWindowState_WindowStateChanged;
 }
Exemple #10
0
 /// <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));
 }