protected override void OnPlaylistsChanged(PlaylistsChanged e) { base.OnPlaylistsChanged(e); m_playlists = e.Playlists; if (m_playlists != null && m_playlists.Count > 0) { if (m_noPlaylistsUI != null) { m_noPlaylistsUI.SetActive(false); } if (m_loadingUI != null) { m_loadingUI.SetActive(true); } if (m_resizeCanvas != null) { m_resizeCanvas.gameObject.SetActive(false); } if (m_loadAsync) { UpdateUICoroutine(m_playlists); } else { UpdateUI(m_playlists); } } else { // No playlists loaded or has no playlists if (m_noPlaylistsUI != null) { m_noPlaylistsUI.SetActive(true); } } }
private void FileWatcherChanged(object sender, FileSystemEventArgs e) { if (e.ChangeType == WatcherChangeTypes.Deleted) { // the file has been removed - remove the corresponding entry bool playlistRemoved = false; lock (iLock) { if (iPlaylists.ContainsKey(e.FullPath)) { iPlaylists.Remove(e.FullPath); playlistRemoved = true; } } // if the file was removed from the list, send event PlaylistRemoved ev = EventPlaylistRemoved; if (playlistRemoved && ev != null) { ev(e.FullPath); } } else { // some unknown change has happened - rescan the save directory lock (iLock) { Rescan(); } // send the event PlaylistsChanged ev = EventPlaylistsChanged; if (ev != null) { ev(); } } }
private void OnChanged(PlaylistsChanged e) { Destroy(this); }
/// <summary> /// Callback for when the service loads all user playlists, a new one is created or one is removed /// </summary> /// <param name="e"></param> protected virtual void OnPlaylistsChanged(PlaylistsChanged e) { }