Beispiel #1
0
        private List <QuestionEntry> buildQuestionEntryList(XmlDocument x)
        {
            XmlNodeList qNodes = x.SelectNodes("/response/question");

            if (qNodes.Count > 0)
            {
                List <QuestionEntry> qList = new List <QuestionEntry>();
                foreach (XmlNode qNode in qNodes)
                {
                    QuestionEntry question = new QuestionEntry();
                    XmlUtils.UseNode(qNode);
                    question.Id             = XmlUtils.Int("qid");
                    question.UserId         = XmlUtils.Int("uid");
                    question.Type           = XmlUtils.Int("type");
                    question.Text           = XmlUtils.String("text");
                    question.AnswersCount   = XmlUtils.Int("answers_num");
                    question.LastPosterDate = XmlUtils.String("last_poster_date");
                    question.LastPosterId   = XmlUtils.Int("last_poster_id");
                    question.LastPosterName = XmlUtils.String("last_poster_name");
                    question.Date           = XmlUtils.String("date");
                    question.UserName       = XmlUtils.String("name");
                    question.UserPhoto      = XmlUtils.String("photo");
                    question.IsUserOnline   = XmlUtils.Bool("online");
                    qList.Add(question);
                }
                return(qList);
            }
            return(null);
        }
Beispiel #2
0
 private List<QuestionEntry> buildQuestionEntryList(XmlDocument x)
 {
     XmlNodeList qNodes = x.SelectNodes("/response/question");
     if (qNodes.Count > 0)
     {
         List<QuestionEntry> qList = new List<QuestionEntry>();
         foreach (XmlNode qNode in qNodes)
         {
             QuestionEntry question = new QuestionEntry();
             XmlUtils.UseNode(qNode);
             question.Id = XmlUtils.Int("qid");
             question.UserId = XmlUtils.Int("uid");
             question.Type = XmlUtils.Int("type");
             question.Text = XmlUtils.String("text");
             question.AnswersCount = XmlUtils.Int("answers_num");
             question.LastPosterDate = XmlUtils.String("last_poster_date");
             question.LastPosterId = XmlUtils.Int("last_poster_id");
             question.LastPosterName = XmlUtils.String("last_poster_name");
             question.Date = XmlUtils.String("date");
             question.UserName = XmlUtils.String("name");
             question.UserPhoto = XmlUtils.String("photo");
             question.IsUserOnline = XmlUtils.Bool("online");
             qList.Add(question);
         }
         return qList;
     }
     return null;
 }