public int Send(int userId, string message, string title, SendMessageType? type)
{
this.Manager.Method("messages.send");
this.Manager.Params("uid", userId);//((type == MessageType.Outgoing) ? "1" : "0"));
this.Manager.Params("message", message);
if (title != null)
{
this.Manager.Params("title", title);
}
if (type != null)
{
this.Manager.Params("type", (int)type);
}
string resp = this.Manager.Execute().GetResponseString();
if (this.Manager.MethodSuccessed)
{
XmlDocument x = this.Manager.GetXmlDocument(resp);
return Convert.ToInt32(x.SelectSingleNode("/response").InnerText);
}
return -1;
}