private void SetCharacterProperties(AniDB_CharacterVM aniChar) { if (dummyMainCharExists != null) dummyMainCharExists.Visible = true; if (dummyMainActorExists != null) dummyMainActorExists.Visible = false; if (dummySeriesExists != null) dummySeriesExists.Visible = false; clearGUIProperty("Character.Name"); clearGUIProperty("Character.KanjiName"); clearGUIProperty("Character.Description"); clearGUIProperty("Character.CharType"); clearGUIProperty("Character.PosterMainChar"); clearGUIProperty("Character.PosterSeries"); setGUIProperty("Character.Name", aniChar.CharName); setGUIProperty("Character.KanjiName", aniChar.CharKanjiName); setGUIProperty("Character.Description", aniChar.CharDescription); setGUIProperty("Character.CharType", aniChar.CharType); string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png"; if (File.Exists(aniChar.PosterPath)) imagePath = aniChar.PosterPath; try { System.Drawing.Image theImage = System.Drawing.Image.FromFile(imagePath); float width = theImage.PhysicalDimension.Width; float height = theImage.PhysicalDimension.Height; if (dummyPosterMainChar != null) dummyPosterMainChar.Visible = height > width; } catch { } setGUIProperty("Character.PosterMainChar", imagePath); SetActorProperties(aniChar); }
private void SetCharacterProperties(AniDB_CharacterVM aniChar) { clearGUIProperty("Character.Name"); clearGUIProperty("Character.KanjiName"); clearGUIProperty("Character.Description"); clearGUIProperty("Character.CharType"); clearGUIProperty("Character.Poster"); clearGUIProperty("Series.Poster"); clearGUIProperty("Series.Title"); setGUIProperty("Character.Name", aniChar.CharName); setGUIProperty("Character.KanjiName", aniChar.CharKanjiName); setGUIProperty("Character.Description", aniChar.CharDescription); setGUIProperty("Character.CharType", aniChar.CharType); string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png"; if (File.Exists(aniChar.PosterPath)) imagePath = aniChar.PosterPath; setGUIProperty("Character.Poster", imagePath); if (aniChar.Anime != null) { setGUIProperty("Series.Title", aniChar.Anime.FormattedTitle); setGUIProperty("Series.Poster", ImageAllocator.GetAnimeImageAsFileName(aniChar.Anime, GUIFacadeControl.Layout.List)); } }
private void SetActorProperties(AniDB_CharacterVM aniChar) { if (dummyMainActorExists != null) dummyMainActorExists.Visible = false; if (dummySeriesExists != null) dummySeriesExists.Visible = false; clearGUIProperty("Actor.Name"); clearGUIProperty("Actor.KanjiName"); clearGUIProperty("Character.PosterMainActor"); clearGUIProperty("Character.PosterSeries"); clearGUIProperty("Character.SeriesName"); clearGUIProperty("Character.SeriesCharacter"); clearGUIProperty("Character.SeriesKanjiCharacter"); string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png"; // get the actor from the character AniDB_SeiyuuVM actor = aniChar.Creator; if (actor == null) { try { System.Drawing.Image theImage = System.Drawing.Image.FromFile(imagePath); float width = theImage.PhysicalDimension.Width; float height = theImage.PhysicalDimension.Height; if (dummyPosterMainActor != null) dummyPosterMainActor.Visible = height > width; } catch { } setGUIProperty("Character.PosterMainActor", imagePath); } else { MainWindow.GlobalSeiyuuID = actor.AniDB_SeiyuuID; if (dummyMainActorExists != null) dummyMainActorExists.Visible = true; setGUIProperty("Actor.Name", actor.SeiyuuName); if (File.Exists(actor.PosterPath)) imagePath = actor.PosterPath; try { System.Drawing.Image theImage = System.Drawing.Image.FromFile(imagePath); float width = theImage.PhysicalDimension.Width; float height = theImage.PhysicalDimension.Height; if (dummyPosterMainActor != null) dummyPosterMainActor.Visible = height > width; } catch { } setGUIProperty("Character.PosterMainActor", imagePath); } }