static void Main(string[] args) { library = new Library(); skipSongs = new SkipSongs(library); //skipSongs.Delete(); SkipSongs(10); Console.WriteLine(); foreach (Song s in skipSongs.GetSongs()) { Console.WriteLine(s.Path); } Console.WriteLine(); foreach (SkipSong ss in skipSongs) { Console.WriteLine(ss.Song.Path); ss.Handle = ProgressType.Remove; } Console.WriteLine(); Console.WriteLine(skipSongs.GetSongs().Count()); foreach (Song s in skipSongs.GetSongs()) { Console.WriteLine(s.Path); } Console.WriteLine(library.Playlists.SelectMany(p => p.Songs).Count()); Console.ReadLine(); }
private void OnSkippedSongsChanged(SkipSongs sender) { string value = string.Empty; ValueSet valueSet = receivers[skipPrimaryKey].GetValueSet(value); Send(valueSet); }
internal Library(CurrentPlaySong currentPlaySong) { IsForeground = false; IsLoaded = false; SkippedSongs = new SkipSongs(this); Playlists = new PlaylistCollection(currentPlaySong); CurrentPlaylist = Playlists.First(); }
internal Library(bool isForeground) { IsForeground = isForeground; IsLoaded = false; SkippedSongs = new SkipSongs(this); Playlists = new PlaylistCollection(); CurrentPlaylist = null; }
protected override void OnNavigatedTo(NavigationEventArgs e) { open = true; list = e.Parameter as SkipSongs; list.SkippedSong += List_SkippedSong; lbxSongs.ItemsSource = list.GetSongs(); base.OnNavigatedTo(e); }
private async static void GetXmlText(ValueSet valueSet) { string text = valueSet["XmlText"].ToString(); if (text == "NotLoaded") { return; } else if (text == "LoadedButEmpty") { CurrentSong.Current.Unset(); Library.Current.SetLoaded(); await SkipSongs.Delete(); } else { Library.Current.Load(text); await SkipSongsPage.NavigateToIfSkipSongsExists(); } }
public static async Task NavigateToIfSkipSongsExists() { if (!Open && Library.IsLoaded) { open = true; SkipSongs skipSongs = await SkipSongs.GetNew(); if (skipSongs.HaveSongs) { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher. RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { (Window.Current.Content as Frame).Navigate(typeof(SkipSongsPage), skipSongs); }); } else { open = false; } } }
private async void SkipSong(Song song) { await SkipSongs.AddSkipSongAndSave(song); ForegroundCommunicator.SendSkip(); }
protected override void OnNavigatedTo(NavigationEventArgs e) { skipSongs = e.Parameter as SkipSongs; SetCurrentSongPath(); }