internal RovioSettings(Rovio rovio) { this.rovio = rovio; this.groupVideo = new VideoGroup(this); this.groupMovement = new MovementGroup(this); this.groupMail = new MailGroup(this); }
private void RemoveDeletedItems(List <object> items) { var audios = AudioGroup.FirstOrDefault(g => (string)g.Key == "audios"); var videos = VideoGroup.FirstOrDefault(g => (string)g.Key == "videos"); foreach (var item in items) { if (item is Audio) { audios.Remove(item); } else if (item is Video) { videos.Remove(item); } else if (item is Doc) { Documents.Remove((Doc)item); } } }
private void OnReloadContentCommand() { switch (LastPivotIndex) { case 0: _audioAlbumsOffset = 0; _audiosOffset = 0; AudioGroup.Refresh(); break; case 1: _videoAlbumsOffset = 0; _videosOffset = 0; VideoGroup.Refresh(); break; case 2: _docsOffset = 0; Documents.Refresh(); break; } }
public async Task <int> Update(VideoGroup videoGroup) { return(await Context.SaveChangesAsync()); }
public async Task <int> Insert(VideoGroup videoGroup) { _videoGroupRepository.Create(videoGroup); return(await Context.SaveChangesAsync()); }
public override void OnNavigatingFrom(NavigatingFromEventArgs e, Dictionary <string, object> viewModelState, bool suspending) { if (e.NavigationMode == NavigationMode.Back && _appLoaderService.IsShowed) { e.Cancel = true; _cancelOperations = true; _appLoaderService.Hide(); return; } if (e.NavigationMode == NavigationMode.Back && IsSelectionMode) { SetDefaultMode(); e.Cancel = true; return; } if (e.NavigationMode == NavigationMode.New) { var audioAlbums = AudioGroup.FirstOrDefault(g => (string)g.Key == "albums"); var audios = AudioGroup.FirstOrDefault(g => (string)g.Key == "audios"); if (audios != null) { audios.CollectionChanged -= Downloadable_CollectionChanged; viewModelState["Audios"] = JsonConvert.SerializeObject(audios.ToList()); } if (audioAlbums != null) { viewModelState["AudioAlbums"] = JsonConvert.SerializeObject(audioAlbums.ToList()); } var videoAlbums = VideoGroup.FirstOrDefault(g => (string)g.Key == "albums"); var videos = VideoGroup.FirstOrDefault(g => (string)g.Key == "videos"); if (videos != null) { viewModelState["Videos"] = JsonConvert.SerializeObject(videos.ToList()); } if (videoAlbums != null) { viewModelState["VideoAlbums"] = JsonConvert.SerializeObject(videoAlbums.ToList()); } Documents.CollectionChanged -= Downloadable_CollectionChanged; viewModelState[nameof(Documents)] = JsonConvert.SerializeObject(Documents.ToList()); viewModelState[nameof(LastPivotIndex)] = LastPivotIndex; viewModelState[nameof(PageTitle)] = PageTitle; viewModelState[nameof(_audiosOffset)] = _audiosOffset; viewModelState[nameof(_audioAlbumsOffset)] = _audioAlbumsOffset; viewModelState[nameof(_videosOffset)] = _videosOffset; viewModelState[nameof(_videoAlbumsOffset)] = _videoAlbumsOffset; viewModelState[nameof(_docsOffset)] = _docsOffset; viewModelState[nameof(AudiosScrollPosition)] = AudiosScrollPosition; viewModelState[nameof(VideosScrollPosition)] = VideosScrollPosition; viewModelState[nameof(DocsScrollPosition)] = DocsScrollPosition; } if (!suspending) { PrimaryItems.Clear(); SecondaryItems.Clear(); SelectedItems.Clear(); } base.OnNavigatingFrom(e, viewModelState, suspending); }
private async void OnDeleteCommand(object obj) { _appLoaderService.Show(String.Format(_locService["AppLoader_DeletingItem"], obj.ToString())); bool isSuccess = false; try { isSuccess = await DeleteObject(obj); } catch (Exception) { } if (obj is Audio) { if (!isSuccess) { _dialogsService.Show(_locService["Message_AudioDeleteError_Text"], _locService["Message_AudioDeleteError_Title"]); } else { var audios = AudioGroup.FirstOrDefault(g => (string)g.Key == "audios"); audios?.Remove(obj); } } else if (obj is Video) { if (!isSuccess) { _dialogsService.Show(_locService["Message_VideoDeleteError_Text"], _locService["Message_VideoDeleteError_Title"]); } else { var videos = VideoGroup.FirstOrDefault(g => (string)g.Key == "videos"); videos?.Remove(obj); } } else if (obj is Doc) { if (!isSuccess) { _dialogsService.Show(_locService["Message_DocDeleteError_Text"], _locService["Message_DocDeleteError_Title"]); } else { Documents.Remove((Doc)obj); } } else if (obj is AudioAlbum) { if (!isSuccess) { _dialogsService.Show(_locService["Message_AudioAlbumDeleteError_Text"], _locService["Message_AudioAlbumDeleteError_Title"]); } else { var audioAlbums = AudioGroup.FirstOrDefault(g => (string)g.Key == "albums"); audioAlbums?.Remove(obj); } } else if (obj is VideoAlbum) { if (!isSuccess) { _dialogsService.Show(_locService["Message_VideoAlbumDeleteError_Text"], _locService["Message_VideoAlbumDeleteError_Title"]); } else { var videoAlbums = VideoGroup.FirstOrDefault(g => (string)g.Key == "albums"); videoAlbums?.Remove(obj); } } _appLoaderService.Hide(); }