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


C# JObject.GetInt32方法代码示例

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


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

示例1: Parse

 /// <summary>
 /// Gets an instance of <code>GridEditorMediaConfigSize</code> from the specified <code>JsonObject</code>.
 /// </summary>
 /// <param name="obj">The instance of <code>JObject</code> to be parsed.</param>
 public static GridEditorMediaConfigSize Parse(JObject obj) {
     if (obj == null) return null;
     return new GridEditorMediaConfigSize(obj) {
         Width = obj.GetInt32("width"),
         Height = obj.GetInt32("height")
     };
 }
开发者ID:skybrud,项目名称:Skybrud.Umbraco.GridData,代码行数:11,代码来源:GridEditorMediaConfigSize.cs

示例2: PinterestUserCounts

 private PinterestUserCounts(JObject obj) : base(obj) {
     Pins = obj.GetInt32("pins");
     Following = obj.GetInt32("following");
     Followers = obj.GetInt32("followers");
     Boards = obj.GetInt32("boards");
     Likes = obj.GetInt32("likes");
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Pinterest,代码行数:7,代码来源:PinterestUserCounts.cs

示例3: PinterestUserImageSize

        private PinterestUserImageSize(JObject obj) : base(obj) {

            JProperty property = obj.Parent as JProperty;
            Alias = property == null ? null : property.Name;

            Url = obj.GetString("url");
            Width = obj.GetInt32("width");
            Height = obj.GetInt32("height");
        
        }
开发者ID:abjerner,项目名称:Skybrud.Social.Pinterest,代码行数:10,代码来源:PinterestUserImageSize.cs

示例4: PinterestError

 private PinterestError(JObject obj) : base(obj) {
     Status = obj.GetString("status");
     Code = obj.GetInt32("code");
     Host = obj.GetString("host");
     GeneratedAt = obj.GetString("generated_at", SocialDateTime.Parse);
     Message = obj.GetString("message");
     Type = obj.GetString("type");
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Pinterest,代码行数:8,代码来源:PinterestError.cs

示例5: Parse

 /// <summary>
 /// Gets a media value from the specified <code>JsonObject</code>.
 /// </summary>
 /// <param name="control">The parent control.</param>
 /// <param name="obj">The instance of <code>JObject</code> to be parsed.</param>
 public static GridControlMediaValue Parse(GridControl control, JObject obj) {
     if (obj == null) return null;
     return new GridControlMediaValue(obj) {
         Control = control,
         FocalPoint = obj.GetObject("focalPoint", GridControlMediaFocalPoint.Parse),
         Id = obj.GetInt32("id"),
         Image = obj.GetString("image"),
         Caption = obj.GetString("caption")
     };
 }
开发者ID:skybrud,项目名称:Skybrud.Umbraco.GridData,代码行数:15,代码来源:GridControlMediaValue.cs

示例6: 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

示例7: 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

示例8: ImagePickerItem

 /// <summary>
 /// Initializes a new image picker item based on the specified <see cref="JObject"/>.
 /// </summary>
 /// <param name="obj">An instanceo of <see cref="JObject"/> representing the item.</param>
 protected ImagePickerItem(JObject obj) {
     JObject = obj;
     Image = obj.GetInt32("imageId", ImagePickerImage.GetFromId);
     Title = obj.GetString("title") ?? "";
     Description = obj.GetString("description") ?? "";
     Link = obj.GetObject("link", LinkPickerItem.Parse) ?? LinkPickerItem.Parse(new JObject());
 }
开发者ID:skybrud,项目名称:Skybrud.ImagePicker,代码行数:11,代码来源:ImagePickerItem.cs

示例9: SpotifyFollowers

 private SpotifyFollowers(JObject obj) : base(obj) {
     Href = obj.GetString("href");
     Total = obj.GetInt32("total");
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Spotify,代码行数:4,代码来源:SpotifyFollowers.cs

示例10: Parse

        /// <summary>
        /// Parses the specified <code>obj</code> into an instance of <see cref="LinkPickerItem"/>.
        /// </summary>
        /// <param name="obj">The instance of <see cref="JObject"/> to be parsed.</param>
        public static LinkPickerItem Parse(JObject obj) {

            if (obj == null) return null;

            // Get the ID
            int id = obj.GetInt32("id");

            // Parse the link mode
            LinkPickerMode mode;
            if (obj.GetValue("mode") == null) {
                if (obj.GetBoolean("isMedia")) {
                    mode = LinkPickerMode.Media;
                } else if (id > 0) {
                    mode = LinkPickerMode.Content;
                } else {
                    mode = LinkPickerMode.Url;
                }
            } else {
                mode = (LinkPickerMode) Enum.Parse(typeof(LinkPickerMode), obj.GetString("mode"), true);
            }
            
            // Parse remaining properties
            return new LinkPickerItem {
                JObject = obj,
                Id = id,
                Name = obj.GetString("name"),
                RawUrl = obj.GetString("url"),
                Target = obj.GetString("target"),
                Mode = mode
            };

        }
开发者ID:skybrud,项目名称:Skybrud.LinkPicker,代码行数:36,代码来源:LinkPickerItem.cs

示例11: PinterestPinCounts

 private PinterestPinCounts(JObject obj) {
     Likes = obj.GetInt32("likes");
     Comments = obj.GetInt32("comments");
     Repins = obj.GetInt32("repins");
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Pinterest,代码行数:5,代码来源:PinterestPinCounts.cs

示例12: SpotifyImage

 private SpotifyImage(JObject obj) : base(obj) {
     Height = obj.GetInt32("height");
     Url = obj.GetString("url");
     Width = obj.GetInt32("width");
 }
开发者ID:abjerner,项目名称:Skybrud.Social.Spotify,代码行数:5,代码来源:SpotifyImage.cs

示例13: UmbracoMediaItem

 internal UmbracoMediaItem(JObject obj)
 {
     Id = obj.GetInt32("id");
     ContentTypeAlias = obj.GetString("contentTypeAlias");
 }
开发者ID:karltynan,项目名称:SirTrevor-for-Umbraco,代码行数:5,代码来源:UmbracoMediaItem.cs

示例14: 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

示例15: UmbracoContentItem

 internal UmbracoContentItem(JObject obj)
 {
     Id = obj.GetInt32("id");
     Name = obj.GetString("name");
 }
开发者ID:karltynan,项目名称:SirTrevor-for-Umbraco,代码行数:5,代码来源:UmbracoContentItem.cs


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