Exemple #1
0
 public void DownloadCharacterImagesForSeiyuu(AniDB_SeiyuuVM seiyuu)
 {
     if (downloadCharacterImagesForSeiyuuWorker.IsBusy)
     {
         return;
     }
     downloadCharacterImagesForSeiyuuWorker.RunWorkerAsync(seiyuu);
 }
Exemple #2
0
        void downloadCharacterImagesForSeiyuuWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            AniDB_SeiyuuVM seiyuu = e.Argument as AniDB_SeiyuuVM;

            List <JMMServerBinary.Contract_AniDB_Character> charContracts = JMMServerVM.Instance.clientBinaryHTTP.GetCharactersForSeiyuu(seiyuu.AniDB_SeiyuuID);

            if (charContracts == null)
            {
                return;
            }

            List <AniDB_CharacterVM> charList = new List <AniDB_CharacterVM>();

            foreach (JMMServerBinary.Contract_AniDB_Character chr in charContracts)
            {
                charList.Add(new AniDB_CharacterVM(chr));
            }

            MainWindow.imageHelper.DownloadAniDBCharactersForSeiyuuSync(charList, false);

            OnGotCharacterImagesEvent(new GotCharacterImagesEventArgs(seiyuu.AniDB_SeiyuuID));
        }
Exemple #3
0
        private void ShowCharacters()
        {
            GUIControl.ClearControl(this.GetID, m_Facade.GetID);

            //if (dummyMainCharExists != null) dummyMainCharExists.Visible = false;
            //if (dummyMainActorExists != null) dummyMainActorExists.Visible = false;
            //if (dummySeriesExists != null) dummySeriesExists.Visible = false;

            clearGUIProperty("Actor.Name");
            clearGUIProperty("Actor.Poster");

            BaseConfig.MyAnimeLog.Write("ActorWindow.GlobalSeiyuuID = {0}", MainWindow.GlobalSeiyuuID.ToString());

            charList.Clear();
            seiyuu = null;

            JMMServerBinary.Contract_AniDB_Seiyuu contract = JMMServerVM.Instance.clientBinaryHTTP.GetAniDBSeiyuu(MainWindow.GlobalSeiyuuID);
            if (contract == null) return;

            seiyuu = new AniDB_SeiyuuVM(contract);

            setGUIProperty("Actor.Name", seiyuu.SeiyuuName);

            string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png";
            if (File.Exists(seiyuu.PosterPath))
                imagePath = seiyuu.PosterPath;

            setGUIProperty("Actor.Poster", imagePath);

            List<JMMServerBinary.Contract_AniDB_Character> charContracts = JMMServerVM.Instance.clientBinaryHTTP.GetCharactersForSeiyuu(MainWindow.GlobalSeiyuuID);
            if (charContracts == null) return;

            foreach (JMMServerBinary.Contract_AniDB_Character chr in charContracts)
                charList.Add(new AniDB_CharacterVM(chr));

            bool missingImages = false;
            string imagePathNoPicture = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_blankchar.png";
            foreach (AniDB_CharacterVM aniChar in charList)
            {
                imagePath = imagePathNoPicture;
                if (!string.IsNullOrEmpty(aniChar.PosterPath) && File.Exists(aniChar.PosterPath))
                    imagePath = aniChar.PosterPath;
                else
                    missingImages = true;

                GUIListItem item = new GUIListItem("");
                item.IconImage = item.IconImageBig = imagePath;
                item.TVTag = aniChar;
                item.OnItemSelected += new GUIListItem.ItemSelectedHandler(onFacadeItemSelected);
                m_Facade.Add(item);

                BaseConfig.MyAnimeLog.Write(aniChar.ToString());
            }

            if (dummyCharactersExist != null)
            {
                if (charList.Count > 0) dummyCharactersExist.Visible = true;
                else dummyCharactersExist.Visible = false;
            }
            setGUIProperty("Character.CharacterCount", charList.Count.ToString());

            if (m_Facade.Count > 0)
            {
                m_Facade.SelectedListItemIndex = 0;

                AniDB_CharacterVM aniChar = m_Facade.SelectedListItem.TVTag as AniDB_CharacterVM;
                if (aniChar != null)
                {
                    SetCharacterProperties(aniChar);
                }
            }

            if (missingImages)
                MainWindow.ServerHelper.DownloadCharacterImagesForSeiyuu(seiyuu);
        }
Exemple #4
0
 public void DownloadCharacterImagesForSeiyuu(AniDB_SeiyuuVM seiyuu)
 {
     if (downloadCharacterImagesForSeiyuuWorker.IsBusy) return;
     downloadCharacterImagesForSeiyuuWorker.RunWorkerAsync(seiyuu);
 }