Ejemplo n.º 1
0
        public void RefreshMiniCalendar()
        {
            try
            {
                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                {
                    MiniCalendar.Clear();
                });

                List <JMMServerBinary.Contract_AniDBAnime> contracts =
                    JMMServerVM.Instance.clientBinaryHTTP.GetMiniCalendar(JMMServerVM.Instance.CurrentUser.JMMUserID.Value, UserSettingsVM.Instance.Dash_MiniCalendarDays);

                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                {
                    foreach (JMMServerBinary.Contract_AniDBAnime contract in contracts)
                    {
                        AniDB_AnimeVM anime = new AniDB_AnimeVM(contract);
                        if (JMMServerVM.Instance.CurrentUser.EvaluateAnime(anime))
                        {
                            MiniCalendar.Add(anime);
                        }
                    }
                    ViewEpsWatchNext_Recent.Refresh();
                });
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
            finally
            {
            }
        }
Ejemplo n.º 2
0
        public void RefreshMiniCalendar()
        {
            try
            {
                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                {
                    MiniCalendar.Clear();
                    ViewMiniCalendar.SortDescriptions.Clear();
                    if (UserSettingsVM.Instance.Dash_MiniCalendarUpcomingOnly)
                    {
                        ViewMiniCalendar.SortDescriptions.Add(new SortDescription("AirDate", ListSortDirection.Ascending));
                    }
                    else
                    {
                        ViewMiniCalendar.SortDescriptions.Add(new SortDescription("AirDate", ListSortDirection.Descending));
                    }
                });

                List <JMMServerBinary.Contract_AniDBAnime> contracts =
                    JMMServerVM.Instance.clientBinaryHTTP.GetMiniCalendar(JMMServerVM.Instance.CurrentUser.JMMUserID.Value, UserSettingsVM.Instance.Dash_MiniCalendarDays);

                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate()
                {
                    DateTime yesterday = DateTime.Now.AddDays(-1);
                    foreach (JMMServerBinary.Contract_AniDBAnime contract in contracts)
                    {
                        bool useAnime = true;
                        if (UserSettingsVM.Instance.Dash_MiniCalendarUpcomingOnly && contract.AirDate < yesterday)
                        {
                            useAnime = false;
                        }

                        if (useAnime)
                        {
                            AniDB_AnimeVM anime = new AniDB_AnimeVM(contract);
                            if (JMMServerVM.Instance.CurrentUser.EvaluateAnime(anime))
                            {
                                MiniCalendar.Add(anime);
                            }
                        }
                    }

                    ViewMiniCalendar.Refresh();
                });
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
            finally
            {
            }
        }
Ejemplo n.º 3
0
        public void RefreshMiniCalendar()
        {
            try
            {
                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate
                {
                    MiniCalendar.Clear();
                    ViewMiniCalendar.SortDescriptions.Clear();
                    ViewMiniCalendar.SortDescriptions.Add(VM_UserSettings.Instance.Dash_MiniCalendarUpcomingOnly ? new SortDescription("AirDate", ListSortDirection.Ascending) : new SortDescription("AirDate", ListSortDirection.Descending));
                });

                List <VM_AniDB_Anime> contracts = VM_ShokoServer.Instance.ShokoServices.GetMiniCalendar(VM_ShokoServer.Instance.CurrentUser.JMMUserID, VM_UserSettings.Instance.Dash_MiniCalendarDays).CastList <VM_AniDB_Anime>();

                System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action) delegate
                {
                    DateTime yesterday = DateTime.Now.AddDays(-1);
                    foreach (VM_AniDB_Anime contract in contracts)
                    {
                        bool useAnime = !(VM_UserSettings.Instance.Dash_MiniCalendarUpcomingOnly && contract.AirDate < yesterday);

                        if (useAnime)
                        {
                            if (VM_ShokoServer.Instance.CurrentUser.EvaluateAnime(contract))
                            {
                                MiniCalendar.Add(contract);
                            }
                        }
                    }

                    ViewMiniCalendar.Refresh();
                });
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }