Пример #1
0
        private void iconsListBox_ItemClicked(object sender, UserControls.ItemClickedEventArgs e)
        {
            int index = iconsListBox.IndexFromPoint(e.X, e.Y);

            if (index != -1)
            {
                iconsListBox.SelectedItem = iconsListBox.Items[iconsListBox.IndexFromPoint(e.X, e.Y)];
                iconsListBox.Select();

                IconPack pack = (IconPack)iconsListBox.SelectedItem;

                this.UpdateIconsPackGroupBox(pack);

                if (e.Button == MouseButtons.Right)
                {
                    this.cmsMediaListBox.Show(this.iconsListBox, e.X, e.Y);
                }
            }
        }
Пример #2
0
        private void mediaListBox_ItemClicked(object sender, UserControls.ItemClickedEventArgs e)
        {
            if (this.mediaListBox.SelectedItem != null && this.mediaListBox.Items.Count > 0)
            {
                IMedia media = mediaListBox.SelectedItem as IMedia;

                if (media == null)
                {
                    return;
                }

                if (media is Song)
                {
                    Song sng = (Song)media;

                    string artistName = sng.Artist.Name;

                    if (!artistName.Equals(this.lblTextArtist.Text)) //bug..
                    {
                        this.lblTextArtist.Text = artistName;

                        SharedData.Downloader.PreferredImageFormat = Shauni.Services.ImageFormat.ExtraLarge;
                        try
                        {
                            EnableLoadingCircle(true);
                            SharedData.Downloader.FindSong(sng.Name, artistName, med => UpdateInformation(artistName, med));
                        }
                        catch
                        {
                            this.lblSearch.Text = artistName + " - " + sng.Name + " is not contained in the last.fm databases";
                            return;
                        }
                    }

                    this.lblTextAlbum.Text    = sng.Album.Name;
                    this.lblTextDuration.Text = Utility.ParseDuration((int)sng.Duration);
                    this.lblTextGenre.Text    = sng.Genre.Name;
                }
            }
        }