Ejemplo n.º 1
0
        public static void Log(string msg)
        {
            try
            {
                if (Dispatcher == null)
                {
                    return;
                }

                Dispatcher.InvokeAsync(() =>
                {
                    try
                    {
                        var vm = ViewModelManager.GetFirstViewModelByType <ErrorViewModel>();

                        if (vm == null)
                        {
                            vm = ViewModelManager.Create <ErrorViewModel>();
                            vm.Show();
                        }

                        vm.AddEntry(msg);
                    }
                    catch
                    {
                        //supress
                    }
                }, DispatcherPriority.Background);
            }
            catch
            {
                //supress
            }
        }
Ejemplo n.º 2
0
        private void ShowEpisodes(Show show)
        {
            try
            {
                if (show == null)
                {
                    return;
                }

                var callback = new Action <Episode>(UpdateViewedOnBacklog);

                ViewModelManager.Create <SeasonViewModel>().Show(show, callback);
            }
            catch (Exception ex)
            {
                ErrorManager.Log(ex);
            }
        }
Ejemplo n.º 3
0
        private void AddShow()
        {
            try
            {
                var vm = ViewModelManager.Create <AddShowViewModel>();
                vm.View.Owner          = View;
                vm.InformationProvider = ip;
                vm.CurrentShows        = shows.ToList();

                if (vm.ShowDialog() != true)
                {
                    return;
                }
                if (vm.NewShow == null)
                {
                    return;
                }

                var show = vm.NewShow;
                if (show.Seasons.Count > 0)
                {
                    show.SelectedSeason = show.Seasons[show.Seasons.Count - 1];
                }

                shows.Add(show);
                SelectedShow = show;

                ImageHelper.LoadDefaultImages(show);
                ImageHelper.GetShowImageUrl(show);

                UpdateTimeline();
                UpdateBacklog();
            }
            catch (Exception ex)
            {
                ErrorManager.Log(ex);
            }
        }
Ejemplo n.º 4
0
 private void App_OnStartup(object sender, StartupEventArgs e)
 {
     ViewModelManager.Create <MainViewModel>().Show();
 }