TraktPlugin.GUI.GUIRecommendationsShows.InitProperties C# (CSharp) Méthode

InitProperties() private méthode

private InitProperties ( ) : void
Résultat void
        private void InitProperties()
        {
            // Fanart
            backdrop.GUIImageOne = FanartBackground;
            backdrop.GUIImageTwo = FanartBackground2;
            backdrop.LoadingImage = loadingImage;

            // load last layout
            CurrentLayout = (Layout)TraktSettings.RecommendedShowsDefaultLayout;
            // update button label
            GUIControl.SetControlLabel(GetID, layoutButton.GetID, GUICommon.GetLayoutTranslation(CurrentLayout));

            // genres
            CurrentGenre = TraktSettings.ShowRecommendationGenre;
            if (genreButton != null) GUIControl.SetControlLabel(GetID, genreButton.GetID, TraktGenres.ItemName(CurrentGenre));

            // toggles for hide collected/watchlisted
            HideCollected = TraktSettings.ShowRecommendationHideCollected;
            HideWatchlisted = TraktSettings.ShowRecommendationHideWatchlisted;
            if (hideCollectedButton != null)
            {
                hideCollectedButton.Selected = HideCollected;
                GUIControl.SetControlLabel(GetID, hideCollectedButton.GetID, Translation.HideCollected);
            }
            if (hideWatchlistedButton != null)
            {
                hideWatchlistedButton.Selected = HideWatchlisted;
                GUIControl.SetControlLabel(GetID, hideWatchlistedButton.GetID, Translation.HideWatchlisted);
            }

            // start/end year
            StartYear = TraktSettings.ShowRecommendationStartYear;
            EndYear = TraktSettings.ShowRecommendationEndYear;
            if (startYearButton != null) GUIControl.SetControlLabel(GetID, startYearButton.GetID, GetStartYearTitle(StartYear));
            if (endYearButton != null) GUIControl.SetControlLabel(GetID, endYearButton.GetID, GetEndYearTitle(EndYear));

            SetRecommendationProperties();

            if (sortButton != null)
            {
                UpdateButtonState();
                sortButton.SortChanged += (o, e) =>
                {
                    TraktSettings.SortByRecommendedShows.Direction = (SortingDirections)(e.Order - 1);
                    PreviousSelectedIndex = 0;
                    UpdateButtonState();
                    LoadRecommendedShows();
                };
            }
        }