当前位置: 首页>>代码示例>>C#>>正文


C# JsonData.GetValue方法代码示例

本文整理汇总了C#中LitJson.JsonData.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# JsonData.GetValue方法的具体用法?C# JsonData.GetValue怎么用?C# JsonData.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LitJson.JsonData的用法示例。


在下文中一共展示了JsonData.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RelatedResults

        public RelatedResults(JsonData resultsJson)
        {
            if (resultsJson == null) return;

            ResultAnnotations = new Annotation(resultsJson.GetValue<JsonData>("annotations"));
            Score = resultsJson.GetValue<double>("score");
            Kind = resultsJson.GetValue<string>("kind");
            JsonData value = resultsJson.GetValue<JsonData>("value");
            ValueAnnotations = new Annotation(value.GetValue<JsonData>("annotations"));
            Retweeted = value.GetValue<bool>("retweeted");
            InReplyToScreenName = value.GetValue<string>("in_reply_to_screen_name");
            var contributors = value.GetValue<JsonData>("contributors");
            Contributors =
                contributors == null ?
                    new List<Contributor>() :
                    (from JsonData contributor in contributors
                     select new Contributor(contributor))
                    .ToList();
            Coordinates = new Coordinate(value.GetValue<JsonData>("coordinates"));
            Place = new Place(value.GetValue<JsonData>("place"));
            User = new User(value.GetValue<JsonData>("user"));
            RetweetCount = value.GetValue<int>("retweet_count");
            IDString = value.GetValue<string>("id_str");
            InReplyToUserID = value.GetValue<ulong>("in_reply_to_user_id");
            Favorited = value.GetValue<bool>("favorited");
            InReplyToStatusIDString = value.GetValue<string>("in_reply_to_status_id_str");
            InReplyToStatusID = value.GetValue<ulong>("in_reply_to_status_id");
            Source = value.GetValue<string>("source");
            CreatedAt = value.GetValue<string>("created_at").GetDate(DateTime.MaxValue);
            InReplyToUserIDString = value.GetValue<string>("in_reply_to_user_id_str");
            Truncated = value.GetValue<bool>("truncated");
            Geo = new Geo(value.GetValue<JsonData>("geo"));
            Text = value.GetValue<string>("text");
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:34,代码来源:RelatedResults.cs

示例2: Friendship

        public Friendship(JsonData friendJson)
        {
            if (friendJson == null) return;

            TargetRelationship = new Relationship(friendJson.GetValue<JsonData>("target"));
            SourceRelationship = new Relationship(friendJson.GetValue<JsonData>("source"));
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:7,代码来源:Friendship.cs

示例3: Media

        public Media(JsonData media)
        {
            if (media == null) return;

            Image = new MediaImage(media.GetValue<JsonData>("image"));
            MediaID = media.GetValue<string>("media_id_string").GetULong(0);
            Size = media.GetValue<int>("size");
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:8,代码来源:Media.cs

示例4: SavedSearch

 public SavedSearch(JsonData searchJson)
 {
     Query = searchJson.GetValue<string>("query");
     Name = searchJson.GetValue<string>("name");
     Postition = searchJson.GetValue<int>("position");
     IDString = searchJson.GetValue<string>("id_str");
     CreatedAt = searchJson.GetValue<string>("created_at").GetDate(DateTime.MaxValue);
 }
开发者ID:CheyPMK,项目名称:linqtotwitter,代码行数:8,代码来源:SavedSearch.cs

示例5: Event

 public Event(JsonData evt)
 {
     Target = new User(evt.GetValue<JsonData>("target"));
     Source = new User(evt.GetValue<JsonData>("source"));
     EventName = evt.GetValue<string>("event");
     var targetObj = evt.GetValue<JsonData>("target_object", defaultValue: null);
     TargetObject = targetObj == null ? (string)null : targetObj.ToString();
     CreatedAt = evt.GetValue<string>("created_at").GetDate(DateTime.MaxValue);
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:9,代码来源:Event.cs

示例6: ForUser

 public ForUser(JsonData user)
 {
     UserID = user.GetValue<ulong>("for_user");
     var message = user.GetValue<JsonData>("message");
     var friends = message.GetValue<JsonData>("friends");
     Friends =
         friends == null ? new List<ulong>() :
         (from JsonData friend in friends
          select (ulong)friend)
         .ToList();
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:11,代码来源:ForUser.cs

示例7: VideoInfo

        public VideoInfo(JsonData videoInfo)
        {
            AspectRatio = new AspectRatio(videoInfo.GetValue<JsonData>("aspect_ratio"));
            Duration = videoInfo.GetValue<int>("duration_millis");
            JsonData variants = videoInfo.GetValue<JsonData>("variants");

            if (variants != null && variants.Count > 0)
                Variants =
                    (from JsonData variant in videoInfo.GetValue<JsonData>("variants")
                     select new Variant(variant))
                    .ToList();
        }
开发者ID:mlzharov,项目名称:LinqToTwitter,代码行数:12,代码来源:VideoInfo.cs

示例8: Category

        public Category(JsonData catJson)
        {
            Size = catJson.GetValue<int>("size");
            Name = catJson.GetValue<string>("name");
            Slug = catJson.GetValue<string>("slug");

            var users = catJson.GetValue<JsonData>("users");
            if (users != null)
                Users =
                    (from JsonData user in users
                     select new User(user))
                    .ToList();
        }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:13,代码来源:Category.cs

示例9: Geometry

        internal Geometry(JsonData geometry)
        {
            if (geometry == null) return;

            Type = geometry.GetValue<string>("type");

            var coordinates = geometry.GetValue<JsonData>("coordinates");
            Coordinates =
                (from JsonData outer in coordinates
                 from JsonData coord in outer
                 select new Coordinate(coord))
                .ToList();
        }
开发者ID:CheyPMK,项目名称:linqtotwitter,代码行数:13,代码来源:Geometry.cs

示例10: Disconnect

 public Disconnect(JsonData json)
 {
     var disconnect = json.GetValue<JsonData>("disconnect");
     Code = disconnect.GetValue<int>("code");
     StreamName = disconnect.GetValue<string>("stream_name");
     Reason = disconnect.GetValue<string>("reason");
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:7,代码来源:Disconnect.cs

示例11: TooManyFollows

 public TooManyFollows(JsonData warning)
 {
     var warn = warning.GetValue<JsonData>("warning");
     Code = warn.GetValue<string>("code");
     Message = warn.GetValue<string>("message");
     UserID = warn.GetValue<ulong>("user_id");
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:7,代码来源:TooManyFollows.cs

示例12: Stall

 public Stall(JsonData stall)
 {
     var warning = stall.GetValue<JsonData>("user_withheld");
     Code = warning.GetValue<string>("code");
     Message = warning.GetValue<string>("message");
     PercentFull = warning.GetValue<int>("percent_full");
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:7,代码来源:Stall.cs

示例13: Delete

 public Delete(JsonData delete)
 {
     var del = delete.GetValue<JsonData>("delete");
     var status = del.GetValue<JsonData>("status");
     StatusID = status.GetValue<ulong>("id");
     UserID = status.GetValue<ulong>("user_id");
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:7,代码来源:Delete.cs

示例14: FriendsList

 public FriendsList(JsonData friends)
 {
     Friends =
         friends == null ? new List<ulong>() :
         (from JsonData friend in friends.GetValue<JsonData>("friends")
          select (ulong)friend)
         .ToList();
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:8,代码来源:FriendsList.cs

示例15: ControlStreamFollow

 public ControlStreamFollow(JsonData csJson)
 {
     var follow = csJson.GetValue<JsonData>("follow");
     User = new ControlStreamUser(follow.GetValue<JsonData>("user"));
     Friends =
         (from JsonData friend in follow.GetValue<JsonData>("friends")
          select (ulong)friend)
         .ToList();
     Cursors = new Cursors(follow);
 }
开发者ID:prog-moh,项目名称:LinqToTwitter,代码行数:10,代码来源:ControlStreamFollow.cs


注:本文中的LitJson.JsonData.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。