コード例 #1
0
ファイル: DirectMessage.cs プロジェクト: bling/Ping.Pong
 public DirectMessage(JsonObject json)
 {
     Id = json["id_str"];
     CreatedAt = json.GetDateTime("created_at");
     Text = json["text"];
     Sender = new User(json["sender"]);
     Recipient = new User(json["recipient"]);
 }
コード例 #2
0
ファイル: Tweet.cs プロジェクト: bling/Ping.Pong
        public Tweet(JsonObject json)
        {
            Text = json["text"]; // explicit conversion will unescape json
            Text = Text.UnescapeXml(); // unescape again for & escapes
            Source = json["source"];
            Id = json["id_str"];
            IsRetweet = json["retweeted"];
            InReplyToStatusId = json["in_reply_to_status_id_str"];
            InReplyToScreenName = json["in_reply_to_screen_name"];
            CreatedAt = json.GetDateTime("created_at");

            JsonValue entities;
            if (json.TryGetValue("entities", out entities))
                Entities = new Entities(entities);

            JsonValue retweetedStatus;
            if (json.TryGetValue("retweeted_status", out retweetedStatus))
                RetweetedStatus = new Tweet((JsonObject)retweetedStatus);

            User = new User(json["user"]);
        }