Наследование: IDisposable
Пример #1
0
        private void SearchFinishedMethod()
        {
            if (main.InvokeRequired)
            {
                ThreadSafeDelegate d = SearchFinishedMethod;
                main.Invoke(d);
                return;
            }

            main.Cursor = Cursors.Default;

              if (_dlgSearchResult.ResultView.Items.Count == 0)
            {
                ServiceScope.Get<ILogger>().GetLogger.Debug("No AlbumInformation found");
                if (RequestArtistAlbum())
                {
                    var albumSearch = new AlbumSearch(this, _selectedArtist, _selectedAlbum);
                    albumSearch.AlbumSites = Options.MainSettings.AlbumInfoSites;
                    albumSearch.Run();
                    return;
                }
            }
            else if (_dlgSearchResult.ResultView.Items.Count == 1)
            {
                // We might have ended up, with just only one Album
                _album = _albums[0];
                ShowAlbumDetails(_album);
            }
            else
            {
                if (main.ShowModalDialog(_dlgSearchResult) == DialogResult.OK)
                {
                    if (_dlgSearchResult.ResultView.SelectedIndices.Count > 0)
                    {
                        _album = (Album) _dlgSearchResult.ResultView.SelectedItems[0].Tag;
                    }
                    else
                    {
                        _album = _albums[0];
                    }
                    ShowAlbumDetails(_album);
                }
                else
                {
                    // Don't ask for album again, since the user cancelled
                    _askForAlbum = false;
                    _dlgSearchResult.Dispose();
                }
            }
            _dlgSearchResult.Dispose();
        }
Пример #2
0
        public void SearchForAlbumInformation()
        {
            // Loop through the selected rows and see, if we got an Artist and/or Album set
              // Need at least an album
              foreach (DataGridViewRow row in _tracksGrid.Rows)
              {
            if (!row.Selected)
              continue;

            TrackData track = Options.Songlist[row.Index];
            if (_selectedArtist == "")
              _selectedArtist = track.Artist;

            if (_selectedAlbum == "")
              _selectedAlbum = track.Album;

            // If we found both values, we can leave
            if (_selectedAlbum != "" && _selectedArtist != "")
              break;
              }

              _askForAlbum = (_selectedAlbum == "");

            // If no Album was specified, we need to show the select dialog
            if (_askForAlbum)
            {
                if (!RequestArtistAlbum())
                    return;
            }

            _askForAlbum = false;
            main.Cursor = Cursors.WaitCursor;
            _dlgSearchResult = new AlbumSearchResult();

            var albumSearch = new AlbumSearch(this, _selectedArtist, _selectedAlbum);
            albumSearch.AlbumSites = Options.MainSettings.AlbumInfoSites;
            albumSearch.Run();
        }
Пример #3
0
        private void DoSearchAlbum()
        {
            groupBoxAmazonMultipleAlbums.Text = ServiceScope.Get<ILocalisation>().ToString("AmazonAlbumSearch", "Searching");
            groupBoxAmazonMultipleAlbums.Refresh();
            Update();

            Cursor = Cursors.WaitCursor;
              tbArtist.Enabled = false;
              tbAlbum.Enabled = false;
              btSearch.Enabled = false;
              btUpdate.Enabled = false;

              var albumSearch = new AlbumSearch(this, _artist, _albumName);
              albumSearch.AlbumSites = Options.MainSettings.AlbumInfoSites;
              albumSearch.Run();
        }