Ejemplo n.º 1
0
        private void Playlist_ListBoxMouseDown(object sender, MouseButtonEventArgs e)
        {
            string x = (sender as NDC.NStyle.Controls.NSListBoxItem).Content.ToString();

            if (e.ChangedButton == MouseButton.Right)
            {
                lbl_playlist_name_cur.Content = string.Empty;
                (sender as NDC.NStyle.Controls.NSListBoxItem).NContainer.Items.Remove(sender);
                File.Delete("Playlists\\" + x + ".NSP");
                lb_tracks.Items.Clear();
            }
            if (e.ChangedButton == MouseButton.Left)
            {
                currentPlayList = new PlayList(x);
                currentPlayList.Load();
                UpdateTracks();
                lbl_playlist_name_cur.Content = currentPlayList.FileName;


                isPlaying = true;
            }
        }
Ejemplo n.º 2
0
        public void GrabInput(string x)
        {
            int index = 0;

            if (!string.IsNullOrEmpty(x))
            {
                foreach (ListBoxItem item in lb_playlists.Items)
                {
                    if ((string)item.Content == x)
                    {
                        UpdateTracks();
                        continue;
                    }
                }
                index = lb_playlists.Add(x);
            }

            (lb_playlists.Items[index - 1] as NDC.NStyle.Controls.NSListBoxItem).PreviewMouseDown += Playlist_ListBoxMouseDown;

            currentPlayList = new PlayList(x);
            UpdateTracks();
        }