public List<EntryComment> GetComments(int? ownerId, int postId, SortOrder sortOrder, int? offset, int? count)
{
this.Manager.Method("wall.getComments");
if (ownerId != null)
{
this.Manager.Params("owner_id", ownerId);//((type == MessageType.Outgoing) ? "1" : "0"));;
}
this.Manager.Params("post_id", postId);
if (sortOrder != null)
{
this.Manager.Params("sort", ((sortOrder == SortOrder.Asc)?"asc":"desc"));
}
if (offset != null)
{
this.Manager.Params("offset", offset);
}
if (count != null)
{
this.Manager.Params("count", count);
}
string resp = this.Manager.Execute().GetResponseString();
if (this.Manager.MethodSuccessed)
{
XmlDocument x = this.Manager.GetXmlDocument(resp);
XmlNodeList nodes = x.SelectNodes("/response/comment");
if (nodes.Count > 0)
{
List<EntryComment> comments = new List<EntryComment>();
foreach (XmlNode node in nodes)
{
EntryComment c = CommentsFactory.GetEntryComment(node);
comments.Add(c);
}
return comments;
}
return null;
}
return null;
}