Пример #1
0
        public static FacebookStatusMessage Parse(JsonObject obj)
        {
            // Return NULL if NULL
            if (obj == null)
            {
                return(null);
            }

            // Some error checking
            if (obj.HasValue("error"))
            {
                throw obj.GetObject("error", FacebookException.Parse);
            }

            // Initialize the link object
            return(new FacebookStatusMessage(obj)
            {
                Id = obj.GetString("id"),
                From = obj.GetObject("from", FacebookObject.Parse),
                Message = obj.GetString("message"),
                MessageTags = FacebookMessageTag.ParseMultiple(obj.GetObject("message_tags")) ?? new FacebookMessageTag[0],
                Application = obj.GetObject("from", FacebookObject.Parse),
                CreatedTime = DateTime.Parse(obj.GetString("created_time")),
                UpdatedTime = DateTime.Parse(obj.GetString("updated_time"))
            });
        }
 public static FacebookStatusMessage Parse(JsonObject obj)
 {
     if (obj == null)
     {
         return(null);
     }
     return(new FacebookStatusMessage(obj)
     {
         Id = obj.GetString("id"),
         From = obj.GetObject("from", FacebookObject.Parse),
         Message = obj.GetString("message"),
         MessageTags = FacebookMessageTag.ParseMultiple(obj.GetObject("message_tags")) ?? new FacebookMessageTag[0],
         Application = obj.GetObject("from", FacebookObject.Parse),
         CreatedTime = DateTime.Parse(obj.GetString("created_time")),
         UpdatedTime = DateTime.Parse(obj.GetString("updated_time"))
     });
 }