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


C# JsonObject.GetArray方法代码示例

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


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

示例1: Parse

 public static TwitterHashTagEntitity Parse(JsonObject entity) {
     return new TwitterHashTagEntitity {
         Text = entity.GetString("text"),
         StartIndex = entity.GetArray("indices").GetInt(0),
         EndIndex = entity.GetArray("indices").GetInt(1)
     };
 }
开发者ID:jesperordrup,项目名称:Skybrud.Social,代码行数:7,代码来源:TwitterHashTagEntity.cs

示例2: Parse

 public static TwitterCoordinates Parse(JsonObject obj) {
     if (obj == null) return null;
     return new TwitterCoordinates(obj) {
         Latitude = obj.GetArray("coordinates").GetDouble(1),
         Longitude = obj.GetArray("coordinates").GetDouble(0)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:TwitterCoordinates.cs

示例3: Parse

 public static TwitterStatusMessageEntities Parse(JsonObject entities) {
     if (entities == null) return null;
     return new TwitterStatusMessageEntities {
         HashTags = TwitterHashTagEntitity.ParseMultiple(entities.GetArray("hashtags")).ToArray(),
         Urls = TwitterUrlEntitity.ParseMultiple(entities.GetArray("urls")).ToArray(),
         Mentions = TwitterMentionEntity.ParseMultiple(entities.GetArray("user_mentions")).ToArray(),
         Media = TwitterMediaEntity.ParseMultiple(entities.GetArray("media")).ToArray()
     };
 }
开发者ID:jesperordrup,项目名称:Skybrud.Social,代码行数:9,代码来源:TwitterStatusMessageEntities.cs

示例4: Parse

 public static TwitterStatusMessageEntities Parse(JsonObject entities) {
     if (entities == null) return null;
     return new TwitterStatusMessageEntities {
         HashTags = entities.GetArray("hashtags", TwitterHashTagEntity.Parse),
         Urls = entities.GetArray("urls", TwitterUrlEntity.Parse),
         Mentions = entities.GetArray("user_mentions", TwitterMentionEntity.Parse),
         Media = entities.GetArray("media", TwitterMediaEntity.Parse) ?? new TwitterMediaEntity[0]
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:9,代码来源:TwitterStatusMessageEntities.cs

示例5: Parse

 public static TwitterUrlEntity Parse(JsonObject entity) {
     return new TwitterUrlEntity {
         Url = entity.GetString("url"),
         ExpandedUrl = entity.GetString("expanded_url"),
         DisplayUrl = entity.GetString("display_url"),
         StartIndex = entity.GetArray("indices").GetInt32(0),
         EndIndex = entity.GetArray("indices").GetInt32(1)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:9,代码来源:TwitterUrlEntity.cs

示例6: Parse

 public static TwitterMentionEntity Parse(JsonObject mention) {
     return new TwitterMentionEntity {
         UserId = mention.GetLong("id"),
         UserIdStr = mention.GetString("id_str"),
         ScreenName = mention.GetString("screen_name"),
         Name = mention.GetString("name"),
         StartIndex = mention.GetArray("indices").GetInt(0),
         EndIndex = mention.GetArray("indices").GetInt(1)
     };
 }
开发者ID:jesperordrup,项目名称:Skybrud.Social,代码行数:10,代码来源:TwitterMentionEntity.cs

示例7: Parse

 /// <summary>
 /// Parse the JSON object of an account.
 /// </summary>
 /// <param name="obj">The JSON object.</param>
 /// <returns></returns>
 public static FacebookAccount Parse(JsonObject obj) {
     if (obj == null) return null;
     return new FacebookAccount(obj) {
         Id = obj.GetString("id"),
         Name = obj.GetString("name"),
         Category = obj.GetString("category"),
         CategoryList = obj.GetArray("category_list", FacebookObject.Parse),
         AccessToken = obj.GetString("access_token"),
         Permissions = obj.GetArray<string>("perms") ?? new string[0]
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:16,代码来源:FacebookAccount.cs

示例8: Parse

 public static TwitterMediaEntity Parse(JsonObject entity) {
     return new TwitterMediaEntity {
         Id = entity.GetInt64("id"),
         IdStr = entity.GetString("id_str"),
         StartIndex = entity.GetArray("indices").GetInt32(0),
         EndIndex = entity.GetArray("indices").GetInt32(1),
         MediaUrl = entity.GetString("media_url"),
         MediaUrlHttps = entity.GetString("media_url_https"),
         Url = entity.GetString("url"),
         DisplayUrl = entity.GetString("display_url"),
         ExpandedUrl = entity.GetString("expanded_url"),
         Type = entity.GetString("type")
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:14,代码来源:TwitterMediaEntity.cs

示例9: Parse

 /// <summary>
 /// Gets an instance of <code>YouTubeChannelList</code> from the specified <code>JsonObject</code>.
 /// </summary>
 /// <param name="obj">The instance of <code>JsonObject</code> to parse.</param>
 public static YouTubeChannelList Parse(JsonObject obj) {
     if (obj == null) return null;
     return new YouTubeChannelList(obj) {
         PageInfo = obj.GetObject("pageInfo", YouTubePageInfo.Parse),
         Items = obj.GetArray("items", YouTubeChannel.Parse)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:11,代码来源:YouTubeChannelList.cs

示例10: Parse

 public static BitBucketCurrentUserResponseBody Parse(JsonObject obj) {
     if (obj == null) return null;
     return new BitBucketCurrentUserResponseBody(obj) {
         User = obj.GetObject("user", BitBucketUser.Parse),
         Repositories = obj.GetArray("repositories", BitBucketUserRepository.Parse)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:BitBucketCurrentUserResponseBody.cs

示例11: Parse

 /// <summary>
 /// Gets a post from the specified <var>JsonObject</var>.
 /// </summary>
 /// <param name="obj">The instance of <var>JsonObject</var> to parse.</param>
 public static FacebookPost Parse(JsonObject obj) {
     if (obj == null) return null;
     return new FacebookPost(obj) {
         Id = obj.GetString("id"),
         From = obj.GetObject("from", FacebookObject.Parse),
         Application = obj.GetObject("application", FacebookObject.Parse),
         Properties = obj.GetArray("properties", FacebookPostProperties.Parse) ?? new FacebookPostProperties[0],
         Caption = obj.GetString("caption"),
         Message = obj.GetString("message"),
         Description = obj.GetString("description"),
         Story = obj.GetString("story"),
         Picture = obj.GetString("picture"),
         Link = obj.GetString("link"),
         Source = obj.GetString("source"),
         Name = obj.GetString("name"),
         Icon = obj.GetString("icon"),
         Type = obj.GetString("type"),
         StatusType = obj.GetString("status_type"),
         ObjectId = obj.GetString("object_id"),
         CreatedTime = obj.GetDateTime("created_time"),
         UpdatedTime = obj.GetDateTime("updated_time"),
         Shares = obj.GetObject("shares", FacebookShares.Parse),
         Likes = obj.GetObject("likes", FacebookLikes.Parse),
         Comments = obj.GetObject("comments", FacebookComments.Parse)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:30,代码来源:FacebookPost.cs

示例12: Parse

        /// <summary>
        /// Gets an instance of <code>FacebookDebugTokenData</code> from the specified <var>JsonObject</var>.
        /// </summary>
        /// <param name="obj">The instance of <code>JsonObject</code> to parse.</param>
        public static FacebookDebugTokenData Parse(JsonObject obj) {
            
            // Check if NULL
            if (obj == null) return null;

            // If an access token doesn't have an expire date, it may be specified as "0". In other scenarios, the
            // property is not present at all. In either case, we should set the "ExpiresAt" property to "NULL".
            DateTime? expiresAt = null;
            if (obj.HasValue("expires_at")) {
                int value = obj.GetInt32("expires_at");
                if (value > 0) expiresAt = SocialUtils.GetDateTimeFromUnixTime(value);
            }

            // Parse the array of scopes
            FacebookScope[] scopes = (
                from name in obj.GetArray<string>("scopes") ?? new string[0]
                select FacebookScope.GetScope(name) ?? new FacebookScope(name)
            ).ToArray();

            // Initialize the instance of FacebookDebugTokenData
            return new FacebookDebugTokenData(obj) {
                AppId = obj.GetInt64("app_id"),
                Application = obj.GetString("application"),
                ExpiresAt = expiresAt,
                IsValid = obj.GetBoolean("is_valid"),
                IssuedAt = obj.HasValue("issued_at") ? (DateTime?) obj.GetDateTimeFromUnixTimestamp("issued_at") : null,
                UserId = obj.GetString("user_id"),
                Scopes = scopes
            };
        
        }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:35,代码来源:FacebookDebugTokenData.cs

示例13: Parse

 public static FacebookLikes Parse(JsonObject obj) {
     if (obj == null) return new FacebookLikes { Data = new FacebookObject[0] };
     return new FacebookLikes {
         Count = obj.GetInt("count"),
         Data = obj.GetArray("data", FacebookObject.Parse) ?? new FacebookObject[0]
     };
 }
开发者ID:jesperordrup,项目名称:Skybrud.Social,代码行数:7,代码来源:FacebookLikes.cs

示例14: Parse

 public static TwitterSearchTweetsResults Parse(JsonObject obj) {
     if (obj == null) return null;
     return new TwitterSearchTweetsResults(obj) {
         Statuses = obj.GetArray("statuses", TwitterStatusMessage.Parse),
         MetaData = obj.GetObject("search_metadata", TwitterSearchTweetsMetaData.Parse)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:TwitterSearchTweetsResults.cs

示例15: Parse

 public static FacebookPhotosCollection Parse(JsonObject obj) {
     if (obj == null) return null;
     return new FacebookPhotosCollection(obj) {
         Data = obj.GetArray("data", FacebookPhoto.Parse),
         Paging = obj.GetObject("paging", FacebookCursorBasedPagination.Parse)
     };
 }
开发者ID:EmilMoe,项目名称:Skybrud.Social,代码行数:7,代码来源:FacebookPhotosCollection.cs


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