ApiCore.Polls.PollsFactory.GetById C# (CSharp) Method

GetById() public method

Get poll information by id
public GetById ( int ownerId, int pollId ) : PollEntry
ownerId int Poll owner id
pollId int Poll id
return PollEntry
        public PollEntry GetById(int? ownerId, int pollId)
        {
            this.Manager.Method("polls.getById");
            this.Manager.Params("poll_id", pollId);
            if (ownerId != null)
            {
                this.Manager.Params("owner_id", ownerId);
            }

            XmlNode result = this.Manager.Execute().GetResponseXml();
            if (this.Manager.MethodSuccessed)
            {
                XmlUtils.UseNode(result);
                PollEntry p = new PollEntry();
                p.Id = XmlUtils.Int("poll_id");
                p.OwnerId = XmlUtils.Int("owner_id");
                p.DateCreated = CommonUtils.FromUnixTime(XmlUtils.Int("created"));
                p.Question = XmlUtils.String("question");
                p.Votes = XmlUtils.Int("votes");
                p.AnswerId = XmlUtils.Int("answer_id");
                p.Answers = this.buildAnswers(result.SelectNodes("answers/answer"));

                return p;
            }

            return null;
        }