protected AbstractSearchScreenData(string screen, string menuItemLabel, PlayableItemCreatorDelegate playableItemCreator) :
   base(screen, menuItemLabel, null, playableItemCreator, false)
 {
   _delayedEvent = new DelayedEvent(Consts.TS_SEARCH_TEXT_TYPE.TotalMilliseconds);
   _delayedEvent.OnEventHandler += OnSearchTimerElapsed;
 }
Exemplo n.º 2
0
 private void ReSetSkipTimer()
 {
   ShowSkipOSD();
   MediaModelSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<MediaModelSettings>();
   if (_skipStepTimer == null)
   {
     _skipStepTimer = new DelayedEvent(settings.SkipStepTimeout * 1000);
     _skipStepTimer.OnEventHandler += SkipStepTimerElapsed;
   }
   _skipStepTimer.EnqueueEvent(this, EventArgs.Empty);
 }
Exemplo n.º 3
0
    private static void StopFocusKeeper(object sender, EventArgs e)
    {
      ServiceRegistration.Get<ILogger>().Info("ApplicationLauncher: Stopping Focus Keeper.");

      Form form = ServiceRegistration.Get<IScreenControl>() as Form;
      if (form != null)
        form.Deactivate -= EnqueueDeactivationEvent;

      _deactivatedEvent.Dispose();
      _deactivatedEvent = null;
      _focusTimer.Dispose();
      _focusTimer = null;
    }
Exemplo n.º 4
0
    /// <summary>
    /// Helper method to prevent stealing focus of main window by other processes during auto start phase of Windows.
    /// </summary>
    private static void StartFocusKeeper()
    {
      Form form = ServiceRegistration.Get<IScreenControl>() as Form;
      if (form != null)
      {
        ServiceRegistration.Get<ILogger>().Info("ApplicationLauncher: Autostart by Windows. Starting Focus Keeper.");
        // Max. seconds after startup of MainForm.
        _focusTimer = new DelayedEvent(10000);
        _focusTimer.OnEventHandler += StopFocusKeeper;
        _focusTimer.EnqueueEvent(null, EventArgs.Empty);

        // Collects all deactivations and executes the handler after 500 ms.
        // This is especially required, because in deactivate event handler it's not possible to reactivate the form.
        _deactivatedEvent = new DelayedEvent(500);
        _deactivatedEvent.OnEventHandler += PreventDeactivate;
        form.Deactivate += EnqueueDeactivationEvent;
      }
    }
Exemplo n.º 5
0
    /// <summary>
    /// Sets or resets the zap timer. When the timer elapses, the new selected channel is tuned.
    /// </summary>
    private void ReSetSkipTimer()
    {
      IsOSDVisible = true;
      IsOSDLevel0 = true;
      IsOSDLevel1 = false;
      IsOSDLevel2 = false;

      UpdateRunningChannelPrograms(ChannelContext.Instance.Channels[_zapChannelIndex]);

      if (_zapTimer == null)
      {
        SlimTvClientSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<SlimTvClientSettings>();
        _zapTimer = new DelayedEvent(settings.ZapTimeout * 1000);
        _zapTimer.OnEventHandler += ZapTimerElapsed;
      }
      // In case of new user action, reset the timer.
      _zapTimer.EnqueueEvent(this, EventArgs.Empty);
    }
Exemplo n.º 6
0
 private void ReSetZapTimer()
 {
   ShowZapOSD();
   SlimTvClientSettings settings = ServiceRegistration.Get<ISettingsManager>().Load<SlimTvClientSettings>();
   if (_zapTimer == null)
   {
     _zapTimer = new DelayedEvent(settings.ZapTimeout * 1000);
     _zapTimer.OnEventHandler += ZapTimerElapsed;
   }
   _zapTimer.EnqueueEvent(this, EventArgs.Empty);
 }