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


C# JsonObject.GetString方法代码示例

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


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

示例1: Parse

        public static GitHubCommitFile Parse(JsonObject obj) {
            
            if (obj == null) return null;

            // Parse the file status
            GitHubCommitFileStatus status;
            string strStatus = obj.GetString("status");
            switch (strStatus) {
                case "added": status = GitHubCommitFileStatus.Added; break;
                case "modified": status = GitHubCommitFileStatus.Modified; break;
                case "renamed": status = GitHubCommitFileStatus.Renamed; break;
                case "removed": status = GitHubCommitFileStatus.Removed; break;
                default: throw new Exception("Unknown status \"\" - please create an issue it can be fixed https://github.com/abjerner/Skybrud.Social/issues/new");
            }

            return new GitHubCommitFile(obj) {
                Filename = obj.GetString("filename"),
                Additions = obj.GetInt32("additions"),
                Deletions = obj.GetInt32("deletions"),
                Changes = obj.GetInt32("changes"),
                Status = status,
                RawUrl = obj.GetString("raw_url"),
                BlobUrl = obj.GetString("blob_url"),
                Patch = obj.GetString("patch")
            };
        
        }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:27,代码来源:GitHubCommitFile.cs

示例2: Parse

 public static TwitterReverseGeocodeQuery Parse(TwitterReverseGeocodeResults results, JsonObject obj) {
     return new TwitterReverseGeocodeQuery(obj) {
         Results = results,
         Url = obj.GetString("url"),
         Type = obj.GetString("type")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:TwitterReverseGeocodeQuery.cs

示例3: Parse

 public static InstagramIdBasedPagination Parse(JsonObject obj) {
     if (obj == null) return null;
     return new InstagramIdBasedPagination(obj) {
         NextUrl = obj.GetString("next_url"),
         NextMaxId = obj.GetString("next_max_id")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:InstagramIdBasedPagination.cs

示例4: Parse

 public static VimeoUrl Parse(JsonObject obj) {
     if (obj == null) return null;
     return new VimeoUrl(obj) {
         Type = obj.GetString("type"),
         Content = obj.GetString("_content")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:VimeoUrl.cs

示例5: Parse

 public static FacebookCursors Parse(JsonObject obj) {
     if (obj == null) return null;
     return new FacebookCursors(obj) {
         After = obj.GetString("after"),
         Before = obj.GetString("before")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:FacebookCursors.cs

示例6: Parse

 public static FacebookObject Parse(JsonObject obj) {
     if (obj == null) return null;
     return new FacebookObject(obj) {
         Id = obj.GetString("id"),
         Name = obj.GetString("name")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:FacebookObject.cs

示例7: Parse

 public static InstagramLikedMediaPagination Parse(JsonObject obj) {
     if (obj == null) return null;
     return new InstagramLikedMediaPagination(obj) {
         NextUrl = obj.GetString("next_url"),
         NextMaxLikeId = obj.GetString("next_max_like_id")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:InstagramLikedMediaPagination.cs

示例8: Parse

 public static GitHubCommitTree Parse(JsonObject obj) {
     if (obj == null) return null;
     return new GitHubCommitTree(obj) {
         Sha = obj.GetString("sha"),
         Url = obj.GetString("url")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:GitHubCommitTree.cs

示例9: Parse

 public static FacebookPaging Parse(JsonObject obj) {
     // TODO: Should we just return NULL if "obj" is NULL?
     if (obj == null) return new FacebookPaging(null);
     return new FacebookPaging(obj) {
         Previous =  obj.GetString("previous"),
         Next = obj.GetString("next")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:8,代码来源:FacebookPaging.cs

示例10: Parse

 public static GitHubCommitParent Parse(JsonObject obj) {
     if (obj == null) return null;
     return new GitHubCommitParent(obj) {
         Sha = obj.GetString("sha"),
         Url = obj.GetString("url"),
         HtmlUrl = obj.GetString("html_url")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:8,代码来源:GitHubCommitParent.cs

示例11: Parse

 public static FacebookCursorBasedPagination Parse(JsonObject obj) {
     if (obj == null) return null;
     return new FacebookCursorBasedPagination(obj) {
         Cursors = obj.GetObject("cursors", FacebookCursors.Parse),
         Previous = obj.GetString("previous"),
         Next = obj.GetString("next")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:8,代码来源:FacebookCursorBasedPagination.cs

示例12: Parse

 public static FacebookPaging Parse(JsonObject obj) {
     FacebookPaging paging = new FacebookPaging();
     if (obj != null) {
         paging.Previous = obj.GetString("previous");
         paging.Next = obj.GetString("next");
     }
     return paging;
 }
开发者ID:jesperordrup,项目名称:Skybrud.Social,代码行数:8,代码来源:FacebookPaging.cs

示例13: Parse

 public static GitHubCommitAuthor Parse(JsonObject obj) {
     if (obj == null) return null;
     return new GitHubCommitAuthor(obj) {
         Name = obj.GetString("name"),
         Email = obj.GetString("email"),
         Date = obj.GetDateTime("date")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:8,代码来源:GitHubCommitAuthor.cs

示例14: Parse

        public static FacebookPostPhotoSummary Parse(JsonObject obj) {
            if (obj == null) return null;
            return new FacebookPostPhotoSummary(obj) {
                Id = obj.GetString("id"),
                PostId = obj.GetString("post_id")
            };

        }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:8,代码来源:FacebookPostPhotoSummary.cs

示例15: Parse

 public static GoogleAccessTokenResponse Parse(JsonObject obj) {
     return new GoogleAccessTokenResponse {
         AccessToken = obj.GetString("access_token"),
         RefreshToken = obj.GetString("refresh_token"),
         ExpiresIn = TimeSpan.FromSeconds(obj.GetInt32("expires_in")),
         TokenType = obj.GetString("token_type")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:8,代码来源:GoogleAccessTokenResponse.cs


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