Exemplo n.º 1
0
 private void _button_MouseLeave(object sender, EventArgs e)
 {
     if (_subtitlesProvider.FileLoaded)
     {
         _activeButton.Button.Text = "";
         StartHideButtonsTimer();
         _activeButton = null;
     }
 }
Exemplo n.º 2
0
 public SubtitlesViewerForm()
 {
     InitializeComponent();
     _intitialFormColor = this.BackColor;
     SwitchOnTransparency();
     _subtitlesProvider.SubtitleChanged  += _subtitlesProvider_SubtitleChanged;
     _subtitlesProvider.PlayStateChanged += _subtitlesProvider_PlayStateChanged;
     SystemEvents.PowerModeChanged       += SystemEvents_PowerModeChanged;
     _timerShowToolTip.Interval           = 1000; //in milliseconds
     _timerShowToolTip.Tick    += _timerShowToolTip_Tick;;
     _timerHideButtons.Interval = 5000;
     _timerHideButtons.Tick    += _timerHideButtons_Tick;
     _playControl = new ControlButton {
         Button = _buttonStart, Text = "Play"
     };
     _controlButtons.Add(_playControl);
     _controlButtons.Add(new ControlButton {
         Button = _buttonForward, Text = "Forward"
     });
     _controlButtons.Add(new ControlButton {
         Button = _buttonBack, Text = "Back"
     });
     _showListControl = new ControlButton {
         Button = _buttonHideList, Text = "Show"
     };
     _controlButtons.Add(_showListControl);
     _controlButtons.Add(new ControlButton {
         Button = _buttonOpenFile, Text = "Open"
     });
     _controlButtons.Add(new ControlButton {
         Button = _buttonClose, Text = "Close"
     });
     _labelSubtitle.ForeColor     = Properties.Settings.Default.Color;
     _labelSubtitle.Font          = Properties.Settings.Default.Font;
     _dataGridSubtitles.ForeColor = Properties.Settings.Default.Color;
     UpdateButtonColors();
 }
Exemplo n.º 3
0
 private void SetActiveControl(object sender)
 {
     _activeButton = _controlButtons.Where(x => x.Button == (Button)sender).Single();
 }