public RefreshPlaylistsForm(PlaylistPersistor playlistPersistor, IYoutubeAccount account) { LOGGER.Info($"Initializing new instance of RefreshPlaylistsForm"); InitializeComponent(); PlaylistPersistor = playlistPersistor; Account = account; RefreshListView(); }
private void refreshButton_Click(object sender, EventArgs e) { LOGGER.Info($"Refreshing playlists of the youtube account"); Enabled = false; PlaylistPersistor.Container.UnregisterAllPlaylists(); var playlists = new YoutubePlaylistCommunicator().LoadPlaylists(Account); foreach (var playlist in playlists) { LOGGER.Info($"Found playlist '{playlist.Title}'"); PlaylistPersistor.Container.RegisterPlaylist(playlist); } PlaylistPersistor.Save(); RefreshListView(); Enabled = true; }