Example #1
0
        private void ButtonPrevieus_Click(object sender, EventArgs e)
        {
            //  Check if the Current Playing Music isn't the first one on list, and the list isn't clear
            if (CurrentPlayingMusicIndex != 0 && Music.Count != 0)
            {
                MusicInitialize(Music[--CurrentPlayingMusicIndex]);

                FlowLayoutPanelMusic.ScrollControlIntoView(FlowLayoutPanelMusic.Controls[CurrentPlayingMusicIndex]);
            }
        }
Example #2
0
        private void ButtonNext_Click(object sender, EventArgs e)
        {
            //  Check if the Current Playing Music isn't the last one on list, and the list isn't clear
            //  and check if the LoopState equale All, to reaPeat the Playlist from the first
            if (CurrentPlayingMusicIndex != Music.Count - 1 && Music.Count != 0)
            {
                MusicInitialize(Music[++CurrentPlayingMusicIndex]);

                FlowLayoutPanelMusic.ScrollControlIntoView(FlowLayoutPanelMusic.Controls[CurrentPlayingMusicIndex]);
            }
            else if (CurrentPlayingMusicIndex == Music.Count - 1)
            {
                CurrentPlayingMusicIndex = 0;
                MusicInitialize(Music[CurrentPlayingMusicIndex]);

                if (LoopState == LoopState.Off)
                {
                    ButtonPlayPause.PerformClick();
                }
            }
        }