Example #1
0
 internal Message(dynamic json)
 {
     this.Number     = json.IsDefined("comment_num") ? (Int32)json.comment_num : 0;
     this.ListenerId = json.IsDefined("user_id") ? (String)json.user_id : String.Empty;
     this.Name       = json.IsDefined("name") ? json.name : String.Empty;
     this.Comment    = json.IsDefined("message") ? json.message : String.Empty;
     this.IsAuth     = json.IsDefined("auth") ? json.auth : false;
     this.IsBan      = json.IsDefined("is_ban") ? json.is_ban : false;
     this.PostTime   = json.IsDefined("time") ? JavaScriptTime.ToDateTime(json.time, TimeZoneKind.Japan) : null;
 }
Example #2
0
        internal Summary(String jsonString)
        {
            var json = DynamicJson.Parse(jsonString);

            this.RoomId        = json.IsDefined("stream_name") ? json.stream_name : String.Empty;
            this.Title         = json.IsDefined("title") ? json.title : String.Empty;
            this.Description   = json.IsDefined("desc") ? json.desc : String.Empty;
            this.Tags          = json.IsDefined("tags") ? json.tags.Deserialize <String[]>() : new String[0];
            this.IdVidible     = json.IsDefined("id_visible") ? json.id_visible : false;
            this.AnonymousOnly = json.IsDefined("anonymous_only") ? json.anonymous_only : false;
            this.Author        = json.IsDefined("author") ? json.author : String.Empty;
            this.Listener      = json.IsDefined("listener") ? (Int32)json.listener : 0;
            this.PageView      = json.IsDefined("viewer") ? (Int32)json.viewer : 0;
            this.StartTime     = json.IsDefined("start_time") && json.start_time != null?JavaScriptTime.ToDateTime(json.start_time, TimeZoneKind.Japan) : null;
        }