Ejemplo n.º 1
0
        private void addToNowPlaying()
        {
            string selItem = null;

            NPlist = null;
            try
            {
                String[] tempList = new String[NPlistbox.Items.Count];
                int      i        = 0;
                int      count    = playlist.count;

                for (int j = 0; j < count; j++)
                {
                    playlist.removeItem(playlist.get_Item(0));
                }

                NPlistbox.Items.Clear();

                selItem = PLlistBox.SelectedItem.ToString();
                Boolean firstLoopTurn = false;
                foreach (String listItem in MyPlaylistData.getPlaylist(selItem))
                {
                    if (firstLoopTurn)
                    {
                        string value = listItem.Substring(listItem.LastIndexOf("\\") + 1);
                        value = "    " + value;
                        NPlistbox.Items.Add(value);

                        media = MediaPlayerControl.newMedia(listItem);
                        playlist.appendItem(media);
                    }
                    firstLoopTurn = true;
                }

                NPlist        = new String[MyPlaylistData.getPlaylist(selItem).Length - 1];
                i             = 0;
                firstLoopTurn = true;
                foreach (String listitem in MyPlaylistData.getPlaylist(selItem))
                {
                    if (firstLoopTurn)
                    {
                        firstLoopTurn = false;
                        continue;
                    }
                    NPlist[i] = listitem;
                    i++;
                }

                MediaPlayerControl.Ctlcontrols.play();
                tabControl1.SelectedTab = tabPage1;
                NPlistbox.SelectedIndex = 0;
            }

            catch (Exception ex)
            {
                MessageBox.Show("Unable to Play!\n\n" + ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void Del_Click(object sender, EventArgs e)
        {
            if (List.Items.Count > 0)
            {
                WMPLib.IWMPMedia media = playlist.get_Item(List.SelectedIndex);
                playlist.removeItem(media);

                List.Items.RemoveAt(List.SelectedIndex);
            }
        }
Ejemplo n.º 3
0
 private void удалитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     p.removeItem(p.Item[selected]);
     ChangePL?.Invoke(this);
 }