コード例 #1
0
        public static List <Raw_AniDB_Vote_HTTP> ProcessVotes(XmlDocument docAnime)
        {
            List <Raw_AniDB_Vote_HTTP> myvotes = new List <Raw_AniDB_Vote_HTTP>();

            if (docAnime != null && docAnime["votes"] != null)
            {
                // get the permanent anime votes
                XmlNodeList myitems = null;
                try
                {
                    myitems = docAnime["votes"]["anime"].GetElementsByTagName("vote");
                    foreach (XmlNode node in myitems)
                    {
                        Raw_AniDB_Vote_HTTP thisVote = new Raw_AniDB_Vote_HTTP();
                        thisVote.ProcessAnime(node);
                        myvotes.Add(thisVote);
                    }
                }
                catch
                {
                }

                // get the temporary anime votes
                try
                {
                    myitems = docAnime["votes"]["animetemporary"].GetElementsByTagName("vote");
                    foreach (XmlNode node in myitems)
                    {
                        Raw_AniDB_Vote_HTTP thisVote = new Raw_AniDB_Vote_HTTP();
                        thisVote.ProcessAnimeTemp(node);
                        myvotes.Add(thisVote);
                    }
                }
                catch
                {
                }

                // get the episode votes
                try
                {
                    myitems = docAnime["votes"]["episode"].GetElementsByTagName("vote");
                    foreach (XmlNode node in myitems)
                    {
                        Raw_AniDB_Vote_HTTP thisVote = new Raw_AniDB_Vote_HTTP();
                        thisVote.ProcessEpisode(node);
                        myvotes.Add(thisVote);
                    }
                }
                catch
                {
                }
            }

            return(myvotes);
        }
コード例 #2
0
ファイル: AniDBHTTPHelper.cs プロジェクト: Bareus/ShokoServer
        public static List <Raw_AniDB_Vote_HTTP> ProcessVotes(XmlDocument docAnime)
        {
            List <Raw_AniDB_Vote_HTTP> myvotes = new List <Raw_AniDB_Vote_HTTP>();

            // get the permanent anime votes
            var myitems = docAnime?["votes"]?["anime"]?.GetElementsByTagName("vote");

            if (myitems != null)
            {
                foreach (XmlNode node in myitems)
                {
                    Raw_AniDB_Vote_HTTP thisVote = new Raw_AniDB_Vote_HTTP();
                    thisVote.ProcessAnime(node);
                    myvotes.Add(thisVote);
                }
            }

            // get the temporary anime votes
            myitems = docAnime?["votes"]?["animetemporary"]?.GetElementsByTagName("vote");
            if (myitems != null)
            {
                foreach (XmlNode node in myitems)
                {
                    Raw_AniDB_Vote_HTTP thisVote = new Raw_AniDB_Vote_HTTP();
                    thisVote.ProcessAnimeTemp(node);
                    myvotes.Add(thisVote);
                }
            }

            // get the episode votes
            myitems = docAnime?["votes"]?["episode"]?.GetElementsByTagName("vote");
            if (myitems != null)
            {
                foreach (XmlNode node in myitems)
                {
                    Raw_AniDB_Vote_HTTP thisVote = new Raw_AniDB_Vote_HTTP();
                    thisVote.ProcessEpisode(node);
                    myvotes.Add(thisVote);
                }
            }

            return(myvotes);
        }