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


C# JObject.GetArray方法代码示例

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


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

示例1: Parse

 internal static TweetEntities Parse(JObject obj)
 {
     return new TweetEntities {
         HashTags = obj.GetArray("hashtags", TweetHashTag.Parse),
         Symbols = new object[0],
         Urls = obj.GetArray("urls", TweetUrl.Parse),
         Mentions = obj.GetArray("user_mentions", TweetUserMention.Parse)
     };
 }
开发者ID:karltynan,项目名称:SirTrevor-for-Umbraco,代码行数:9,代码来源:TweetEntities.cs

示例2: Parse

 internal static TweetHashTag Parse(JObject obj)
 {
     JArray array = obj.GetArray("indices");
     return new TweetHashTag {
         Text = obj.GetString("text"),
         Indices = new[] {
             array.GetInt32(0),
             array.GetInt32(1)
         }
     };
 }
开发者ID:karltynan,项目名称:SirTrevor-for-Umbraco,代码行数:11,代码来源:TweetHashTag.cs

示例3: SpotifyArtist

 private SpotifyArtist(JObject obj) : base(obj) {
     ExternalUrls = obj.GetObject("external_urls", SpotifyArtistUrlCollection.Parse);
     Followers = obj.GetObject("followers", SpotifyFollowers.Parse);
     Genres = obj.GetStringArray("genres");
     Href = obj.GetString("href");
     Id = obj.GetString("id");
     Images = obj.GetArray("images", SpotifyImage.Parse);
     Name = obj.GetString("name");
     Popularity = obj.GetInt32("popularity");
     Type = obj.GetString("type");
     Uri = obj.GetString("uri");
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Spotify,代码行数:12,代码来源:SpotifyArtist.cs

示例4: Parse

 internal static TweetUrl Parse(JObject obj)
 {
     JArray array = obj.GetArray("indices");
     return new TweetUrl {
         Url = obj.GetString("url"),
         ExpandedUrl = obj.GetString("expanded_url"),
         DisplayUrl = obj.GetString("display_url"),
         Indices = new[] {
             array.GetInt32(0),
             array.GetInt32(1)
         }
     };
 }
开发者ID:karltynan,项目名称:SirTrevor-for-Umbraco,代码行数:13,代码来源:TweetUrl.cs

示例5: Parse

 internal static TweetUserMention Parse(JObject obj)
 {
     JArray array = obj.GetArray("indices");
     return new TweetUserMention {
         ScreenName = obj.GetString("screen_name"),
         Name = obj.GetString("name"),
         Id = obj.GetInt64("id"),
         Indices = new[] {
             array.GetInt32(0),
             array.GetInt32(1)
         }
     };
 }
开发者ID:karltynan,项目名称:SirTrevor-for-Umbraco,代码行数:13,代码来源:TweetUserMention.cs

示例6: Parse

        /// <summary>
        /// Parses a section from the specified <code>obj</code>.
        /// </summary>
        /// <param name="model">The parent model of the section.</param>
        /// <param name="obj">The instance of <code>JObject</code> to be parsed.</param>
        public static GridSection Parse(GridDataModel model, JObject obj) {

            // Some input validation
            if (obj == null) throw new ArgumentNullException("obj");

            // Parse basic properties
            GridSection section = new GridSection(obj) {
                Model = model,
                Grid = obj.GetInt32("grid")
            };

            // Parse the rows
            section.Rows = obj.GetArray("rows", x => GridRow.Parse(section, x)) ?? new GridRow[0];

            // Update "PreviousRow" and "NextRow" properties
            for (int i = 1; i < section.Rows.Length; i++) {
                section.Rows[i - 1].NextRow = section.Rows[i];
                section.Rows[i].PreviousRow = section.Rows[i - 1];
            }

            // Return the section
            return section;

        }
开发者ID:skybrud,项目名称:Skybrud.Umbraco.GridData,代码行数:29,代码来源:GridSection.cs

示例7: Parse

 public static GridDataModel Parse(JObject obj) {
     if (obj == null) return null;
     return new GridDataModel(obj) {
         Raw = obj.ToString(),
         Name = obj.GetString("name"),
         Sections = obj.GetArray("sections", x => GridSection.Parse(null, obj)) ?? new GridSection[0]
     };
 }
开发者ID:skybrud,项目名称:Skybrud.Umbraco.GridData,代码行数:8,代码来源:GridDataModel.cs

示例8: ImagePickerList

 /// <summary>
 /// Initializes a new instance based on the specified <see cref="JObject" />.
 /// </summary>
 /// <param name="obj">An instance of <see cref="JObject" /> representing the image picker list.</param>
 protected ImagePickerList(JObject obj) {
     JObject = obj;
     Title = obj.GetString("title") ?? "";
     Items = (obj.GetArray("items", ImagePickerItem.Parse) ?? new ImagePickerItem[0]).Where(x => x.IsValid).ToArray();
 }
开发者ID:skybrud,项目名称:Skybrud.ImagePicker,代码行数:9,代码来源:ImagePickerList.cs

示例9: OpeningHoursWeekdayItem

 protected OpeningHoursWeekdayItem(JObject obj) : base(obj) {
     Label = obj.GetString("label") ?? "";
     Items = obj.GetArray("items", OpeningHoursTimeSlot.Parse);
     ParseLegacyValues();
 }
开发者ID:bomortensen,项目名称:Our.Umbraco.OpeningHours,代码行数:5,代码来源:OpeningHoursWeekdayItem.cs

示例10: Parse

        /// <summary>
        /// Parses a row from the specified <code>obj</code>.
        /// </summary>
        /// <param name="section">The parent section of the row.</param>
        /// <param name="obj">The instance of <code>JObject</code> to be parsed.</param>
        public static GridRow Parse(GridSection section, JObject obj) {

            // Some input validation
            if (obj == null) throw new ArgumentNullException("obj");
            
            // Parse basic properties
            GridRow row = new GridRow(obj) {
                Section = section,
                Id = obj.GetString("id"),
                Alias = obj.GetString("alias"),
                Name = obj.GetString("name"),
                Styles = obj.GetObject("styles", GridDictionary.Parse),
                Config = obj.GetObject("config", GridDictionary.Parse)
            };

            // Parse the areas
            row.Areas = obj.GetArray("areas", x => GridArea.Parse(row, x)) ?? new GridArea[0];

            // Update "PreviousArea" and "NextArea" properties
            for (int i = 1; i < row.Areas.Length; i++) {
                row.Areas[i - 1].NextArea = row.Areas[i];
                row.Areas[i].PreviousArea = row.Areas[i - 1];
            }

            // Return the row
            return row;

        }
开发者ID:skybrud,项目名称:Skybrud.Umbraco.GridData,代码行数:33,代码来源:GridRow.cs

示例11: SpotifyArtistCollection

 private SpotifyArtistCollection(JObject obj) : base(obj) {
     Artists = obj.GetArray("artists", SpotifyArtist.Parse);
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Spotify,代码行数:3,代码来源:SpotifyArtistCollection.cs

示例12: Parse

        /// <summary>
        /// Parses an area from the specified <code>obj</code>.
        /// </summary>
        /// <param name="row">The parent row of the area.</param>
        /// <param name="obj">The instance of <code>JObject</code> to be parsed.</param>
        public static GridArea Parse(GridRow row, JObject obj) {

            // Some input validation
            if (obj == null) throw new ArgumentNullException("obj");
            
            // Parse the array of allow blocks
            JArray allowed = obj.GetArray("allowed");
            
            // Parse basic properties
            GridArea area = new GridArea(obj) {
                Row = row,
                Grid = obj.GetInt32("grid"),
                AllowAll = obj.GetBoolean("allowAll"),
                Allowed = allowed == null ? new string[0] : allowed.Select(x => (string)x).ToArray(),
                Styles = obj.GetObject("styles", GridDictionary.Parse),
                Config = obj.GetObject("config", GridDictionary.Parse)
            };

            // Parse the controls
            area.Controls = obj.GetArray("controls", x => GridControl.Parse(area, x)) ?? new GridControl[0];
            
            // Update "PreviousArea" and "NextArea" properties
            for (int i = 1; i < area.Controls.Length; i++) {
                area.Controls[i - 1].NextControl = area.Controls[i];
                area.Controls[i].PreviousControl = area.Controls[i - 1];
            }
            
            // Return the row
            return area;
        
        }
开发者ID:skybrud,项目名称:Skybrud.Umbraco.GridData,代码行数:36,代码来源:GridArea.cs


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