ApiCore.Activity.ActivityFactory.Get C# (CSharp) Method

Get() public method

Gets the current activity
public Get ( int userId ) : ActivityEntry
userId int if null - current user activity was been returned, if specified - friend activity was been returned
return ActivityEntry
        public ActivityEntry Get(int? userId)
        {
            this.Manager.Method("activity.get");
            if (userId != null)
            {
                this.Manager.Params("uid", userId);//((type == MessageType.Outgoing) ? "1" : "0"));;
            }
            string resp = this.Manager.Execute().GetResponseString();
            if (this.Manager.MethodSuccessed)
            {
                XmlDocument x = this.Manager.GetXmlDocument(resp);
                if (x.SelectSingleNode("/response").InnerText.Equals("0"))
                {
                    return null;
                }
                XmlNode actNode = x.SelectSingleNode("/response");
                ActivityEntry act = new ActivityEntry();
                act.Id = Convert.ToInt32(actNode.SelectSingleNode("id").InnerText);
                act.Text = actNode.SelectSingleNode("activity").InnerText;
                act.Date = CommonUtils.FromUnixTime(actNode.SelectSingleNode("time").InnerText);
                return act;
            }
            return null;
        }