Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.UpdateTimer.Enabled = false;
            hotkeyHelper.UnregisterHotkeys();
            using (Mini dialog = new Mini())
            {
                dialog.ShowDialog();
            }
            playKey = hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt);
            nextKey = hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt);
            hotkeyHelper.OnHotkey += new HotkeyEventHandler(OnHotkey);
            if (PlayList.SelectedItems.Count != 0)
            {
                PlayList.SelectedItems[0].Selected = false;
            }
            int currentset = Core.PlayList.IndexOf(Core.currentset, 0);
            if (currentset == -1) { currentset = 0; }
            PlayList.Items[currentset].Selected = true;
            PlayList.EnsureVisible(currentset);
            PlayList.Focus();
            Core.setBG();
            if (Core.Isplaying)
            {
                TrackSeek.Maximum = (int)Core.Durnation * 1000;
                TrackSeek.Enabled = true;
                UpdateTimer.Enabled = true;
                PlayButton.Text = "暂停";
                StopButton.Enabled = true;

            }
            else
            {
                TrackSeek.Enabled = false;
                UpdateTimer.Enabled = false;
                PlayButton.Text = "播放";
                StopButton.Enabled = false;
            }
            this.Visible = true;
        }
Esempio n. 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.UpdateTimer.Enabled = false;
            hotkeyHelper.UnregisterHotkeys();
            NotifySystem.RegisterClick(null);
            using (var dialog = new Mini())
            {
                dialog.ShowDialog();
            }
            NotifySystem.RegisterClick(TaskbarIconClickHandler);
            playKey = hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt);
            nextKey = hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt);
            hotkeyHelper.OnHotkey += OnHotkey;
            if (Main_PlayList.SelectedItems.Count != 0)
            {
                Main_PlayList.SelectedItems[0].Selected = false;
            }
            int currentset = Core.PlayList.IndexOf(Core.currentset, 0);
            if (currentset == -1) { currentset = 0; }
            Main_PlayList.Items[currentset].Selected = true;
            Main_PlayList.EnsureVisible(currentset);
            Main_PlayList.Focus();
            Core.SetBG();
            if (Core.Isplaying)
            {
                Main_Time_Trackbar.Maximum = (int)Core.Durnation * 1000;
                Main_Time_Trackbar.Enabled = true;
                UpdateTimer.Enabled = true;
                Main_Play.Text = "暂停";
                Main_Stop.Enabled = true;

            }
            else
            {
                Main_Time_Trackbar.Enabled = false;
                UpdateTimer.Enabled = false;
                Main_Play.Text = "播放";
                Main_Stop.Enabled = false;
            }
            this.Visible = true;
        }
Esempio n. 3
0
 private void Main_Mini_Switcher_Click(object sender, EventArgs e)
 {
     Visible = false;
     UpdateTimer.Enabled = false;
     _hotkeyHelper.UnregisterHotkeys();
     NotifySystem.RegisterClick(null);
     using (var dialog = new Mini())
     {
         dialog.ShowDialog();
     }
     NotifySystem.RegisterClick(TaskbarIconClickHandler);
     _playKey = _hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt);
     _prevKey = _hotkeyHelper.RegisterHotkey(Keys.Left, KeyModifiers.Alt);
     _nextKey = _hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt);
     _hotkeyHelper.OnHotkey += OnHotkey;
     Main_PlayList.SelectedIndices.Clear();
     int currentset = Core.CurrentSetIndex;
     if (currentset == -1)
     {
         currentset = 0;
     }
     Main_PlayList.SelectedIndices.Add(currentset);
     Main_PlayList.EnsureVisible(currentset);
     Main_PlayList.Focus();
     Core.SetBG();
     if (Core.Isplaying)
     {
         Main_Time_Trackbar.MaxValue = (int)Core.Durnation * 1000;
         Main_Time_Trackbar.Enabled = true;
         UpdateTimer.Enabled = true;
         Main_Play.Text = LanguageManager.Get("Main_Pause_Text");
         Main_Stop.Enabled = true;
     }
     else
     {
         Main_Time_Trackbar.Enabled = false;
         UpdateTimer.Enabled = false;
         Main_Play.Text = LanguageManager.Get("Main_Play_Text");
         Main_Stop.Enabled = false;
     }
     Visible = true;
 }