protected override void Unload() { _searchWindow.Dispose(); _searchIcon.Dispose(); ModuleInstance = null; }
public override void Execute(object sender, HandledEventArgs e) { SearchWindow searchDialog = new SearchWindow(); searchDialog.ShowDialog(); if (searchDialog.DialogResult != DialogResult.OK) { return; // cancelled search } string searchText = searchDialog.SearchText; var searchType = searchDialog.Type; searchDialog.Dispose(); if (searchType == SearchType.Track) { SearchForTracks(searchText); } else if (searchType == SearchType.Artist) { SearchForArtists(searchText); } else if (searchType == SearchType.Album) { SearchForAlbums(searchText); } }