private void mniAddMusic_Click(object sender, RoutedEventArgs e) { Task.Factory.StartNew(() => Util.NotifyEvent("AddMusic")); try { Main main = Util.TryFindParent <Main>(this); if (main != null) { main.OldSelectedItems = main.SelectedItems; main.SelectedItems = EntityType.Music; main.OldAction = main.Action; main.Action = EntityAction.Added; var objAddMusic = new MusicUpdate(); objAddMusic.ShowDialog(); main.ShowMusic(main.Action); } } catch (Exception ex) { CatchException(ex); } finally { Cursor = null; } }
private void UpdateItem(ThumbItem thumbItem) { try { bool?saved = false; switch (thumbItem.EType) { case EntityType.Apps: AppsUpdate objAppsDetails = new AppsUpdate(); objAppsDetails.ItemsId = thumbItem.Id; saved = objAppsDetails.ShowDialog(); break; case EntityType.Books: BookUpdate objBookDetails = new BookUpdate(); objBookDetails.ItemsId = thumbItem.Id; saved = objBookDetails.ShowDialog(); break; case EntityType.Games: GameUpdate objGameDetails = new GameUpdate(); objGameDetails.ItemsId = thumbItem.Id; saved = objGameDetails.ShowDialog(); break; case EntityType.Movie: MovieUpdate objMovieDetails = new MovieUpdate(); objMovieDetails.ItemsId = thumbItem.Id; saved = objMovieDetails.ShowDialog(); break; case EntityType.Music: MusicUpdate objMusicDetails = new MusicUpdate(); objMusicDetails.ItemsId = thumbItem.Id; saved = objMusicDetails.ShowDialog(); break; case EntityType.Nds: NdsUpdate objNdsDetails = new NdsUpdate(); objNdsDetails.ItemsId = thumbItem.Id; saved = objNdsDetails.ShowDialog(); break; case EntityType.Series: SerieUpdate objSerieDetails = new SerieUpdate(); objSerieDetails.ItemsId = thumbItem.Id; saved = objSerieDetails.ShowDialog(); break; case EntityType.XXX: XxxUpdate objXxxDetails = new XxxUpdate(); objXxxDetails.ItemsId = thumbItem.Id; saved = objXxxDetails.ShowDialog(); break; } if (saved == true) { RoutedEventArgs args = new RoutedEventArgs(SaveEventCf); RaiseEvent(args); } } catch (Exception ex) { CatchException(ex); } }