ApiCore.Messages.MessagesFactory.Send C# (CSharp) Method

Send() public method

Send personal message
public Send ( int userId, string message, string title, SendMessageType type ) : int
userId int to user
message string message body
title string message title. null allowed
type SendMessageType message type. null allowed
return int
        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;
        }