Esempio n. 1
0
        internal void PlayOrPause()
        {
            if (_isPlayingFromTheList)
            {
                if (IsPlaying)
                {
                    ImageWorker.ChangeButtonImageToPause(mainWindow.imageButton.Source);
                    _isPlayingFromTheList = false;
                    return;
                }
                if (!IsPlaying)
                {
                    ImageWorker.ChangeButtonImageToPlay(mainWindow.imageButton.Source);//меняем фотку кнопки на плей
                    _isPlayingFromTheList = false;
                    return;
                }
            }

            if (IsPlaying)
            {
                PauseTheSong();
                ImageWorker.ChangeButtonImageToPlay(mainWindow.imageButton.Source);//меняем фотку кнопки на плей
            }
            else
            {
                if (musicListBox.SelectedIndex < 0 || IsStoped)
                {
                    musicListBox.SelectedIndex = 0;
                }
                _isTheSameSong = true;
                PlayTheSong();
                ImageWorker.ChangeButtonImageToPause(mainWindow.imageButton.Source);
            }
        }
Esempio n. 2
0
 internal void StopOrNo()
 {
     if (IsPlaying || IsPaused)
     {
         StopTheSong();
         ImageWorker.ChangeButtonImageToPlay(mainWindow.imageButton.Source);
     }
 }