public void SaveState(Dictionary <string, object> statePageState, List <Type> knownTypes) { knownTypes.Add(typeof(string)); var stateAsString = PlaylistManagementService.GetStateAsString(); statePageState.Add(PlaylistServiceStateKey, stateAsString); }
public void Ctor_Always_SetsGetNextTrackNumberFuncToGetNextTrackNumber() { var playlistManagementService = new PlaylistManagementService(_mockEventAggregator); playlistManagementService.GetNextTrackNumberFunc.Should() .Be((Func <int>)playlistManagementService.GetNextTrackNumber); }
public void Ctor_Always_SetsStartPlaybackActionToStartPlyaback() { var playlistManagementService = new PlaylistManagementService(_mockEventAggregator); playlistManagementService.StartPlaybackAction.Should() .Be((Action <int>)playlistManagementService.StartPlayback); }
public void LoadState(string parameter, Dictionary <string, object> statePageState) { if (!statePageState.ContainsKey(PlaylistServiceStateKey) || PlaylistManagementService.Items.Any()) { return; } PlaylistManagementService.SetStateFromString((string)statePageState[PlaylistServiceStateKey]); }
private async Task AddToPlaylist(IEnumerable <ISubsonicModel> items, bool clearCurrent = false) { if (clearCurrent) { EventAggregator.Publish(new StopMessage()); PlaylistManagementService.Clear(); _playNextItem = true; } foreach (var item in items) { await AddItemToPlaylist(item); } }
private void PlaylistManagementServiceOnPropertyChanged( object sender, PropertyChangedEventArgs propertyChangedEventArgs) { if (propertyChangedEventArgs.PropertyName == PlaylistManagementService.GetPropertyName(() => PlaylistManagementService.ShuffleOn)) { NotifyOfPropertyChange(() => ShuffleOn); } if (propertyChangedEventArgs.PropertyName == PlaylistManagementService.GetPropertyName(() => PlaylistManagementService.IsPlaying)) { NotifyOfPropertyChange(() => IsPlaying); } }
public void TestInitialize() { _mockEventAggregator = new MockEventAggregator(); _subject = new PlaylistManagementService(_mockEventAggregator); }