private void SetCharacterProperties(CL_AniDB_Character aniChar, VM_AniDB_Anime anime = null)
        {
            SetGUIProperty(GuiProperty.Actors_Character_Name, aniChar.CharName);
            SetGUIProperty(GuiProperty.Actors_Character_KanjiName, aniChar.CharKanjiName);
            SetGUIProperty(GuiProperty.Actors_Character_Description, aniChar.CharDescription);
            SetGUIProperty(GuiProperty.Actors_Character_CharType, aniChar.CharType);

            string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png";

            if (File.Exists(aniChar.GetPosterPath()))
            {
                imagePath = aniChar.GetPosterPath();
            }

            SetGUIProperty(GuiProperty.Actors_Character_Poster, imagePath);

            if (anime != null)
            {
                SetGUIProperty(GuiProperty.Actors_Series_Title, anime.FormattedTitle);
                SetGUIProperty(GuiProperty.Actors_Series_Poster,
                               ImageAllocator.GetAnimeImageAsFileName(anime, GUIFacadeControl.Layout.List));
            }
            else
            {
                ClearGUIProperty(GuiProperty.Actors_Series_Title);
                ClearGUIProperty(GuiProperty.Actors_Series_Poster);
            }
        }
Exemple #2
0
        private void SetCharacterProperties(CL_AniDB_Character aniChar)
        {
            if (dummyMainCharExists != null)
            {
                dummyMainCharExists.Visible = true;
            }
            if (dummyMainActorExists != null)
            {
                dummyMainActorExists.Visible = false;
            }
            if (dummySeriesExists != null)
            {
                dummySeriesExists.Visible = false;
            }

            ClearGUIProperty(GuiProperty.Character_PosterSeries);
            SetGUIProperty(GuiProperty.Character_Name, aniChar.CharName);
            SetGUIProperty(GuiProperty.Character_KanjiName, aniChar.CharKanjiName);
            SetGUIProperty(GuiProperty.Character_Description, aniChar.CharDescription);
            SetGUIProperty(GuiProperty.Character_CharType, aniChar.CharType);

            string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png";

            if (File.Exists(aniChar.GetPosterPath()))
            {
                imagePath = aniChar.GetPosterPath();
            }

            try
            {
                Image theImage = Image.FromFile(imagePath);
                float width    = theImage.PhysicalDimension.Width;
                float height   = theImage.PhysicalDimension.Height;

                if (dummyPosterMainChar != null)
                {
                    dummyPosterMainChar.Visible = height > width;
                }
            }
            catch
            {
            }

            SetGUIProperty(GuiProperty.Character_PosterMainChar, imagePath);

            SetActorProperties(aniChar);
        }