Int() публичный статический Метод

Gets the int value from node
public static Int ( string nodeName ) : int
nodeName string node
Результат int
Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="node"></param>
 /// <returns></returns>
 public static CommentsInfo GetCommentsInfo(XmlNode node)
 {
     if (node != null)
     {
         XmlUtils.UseNode(node);
         CommentsInfo c = new CommentsInfo();
         c.Count      = XmlUtils.Int("count");
         c.CanComment = XmlUtils.Bool("can_post");
         return(c);
     }
     return(null);
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="node"></param>
        /// <returns></returns>
        public static EntryComment GetEntryComment(XmlNode node)
        {
            XmlUtils.UseNode(node);
            EntryComment e = new EntryComment();

            e.Id             = XmlUtils.Int("cid");
            e.Date           = CommonUtils.FromUnixTime(XmlUtils.Int("date"));
            e.Text           = XmlUtils.String("text");
            e.UserId         = XmlUtils.Int("uid");
            e.ReplyToComment = XmlUtils.Int("reply_to_сid");
            e.ReplyToUser    = XmlUtils.Int("reply_to_uid");
            return(e);
        }
Пример #3
0
 public static LikesInfo GetLikesInfo(XmlNode node)
 {
     if (node != null)
     {
         XmlUtils.UseNode(node);
         LikesInfo l = new LikesInfo();
         l.CanLike    = XmlUtils.Bool("can_like");
         l.CanPublish = XmlUtils.Bool("can_publish");
         l.Count      = XmlUtils.Int("count");
         l.UserLikes  = XmlUtils.Int("user_likes");
         return(l);
     }
     return(null);
 }
Пример #4
0
        public static AttachmentData GetAttachment(AttachmentType type, XmlNode attachmentData)
        {
            XmlUtils.UseNode(attachmentData);
            switch (type)
            {
            case AttachmentType.Application:
            {
                AttachmentApplication a = new AttachmentApplication();
                a.Id           = XmlUtils.Int("app_id");
                a.Name         = XmlUtils.String("app_name");
                a.PictureUrl   = XmlUtils.String("src_big");
                a.ThumbnailUrl = XmlUtils.String("src");
                return(a);

                break;
            }

            case AttachmentType.Audio:
            {
                AttachmentAudio a = new AttachmentAudio();
                a.Id        = XmlUtils.Int("aid");
                a.OwnerId   = XmlUtils.Int("owner_id");
                a.Performer = XmlUtils.String("performer");
                a.Title     = XmlUtils.String("title");
                a.Duration  = XmlUtils.Int("duration");
                return(a);

                break;
            }

            case AttachmentType.Checkin:
            {
                break;
            }

            case AttachmentType.Graffiti:
            {
                AttachmentGraffiti a = new AttachmentGraffiti();
                a.Id           = XmlUtils.Int("gid");
                a.OwnerId      = XmlUtils.Int("owner_id");
                a.PictureUrl   = XmlUtils.String("src_big");
                a.ThumbnailUrl = XmlUtils.String("src");
                return(a);

                break;
            }

            case AttachmentType.Note:
            {
                AttachmentNote a = new AttachmentNote();
                a.Id            = XmlUtils.Int("nid");
                a.OwnerId       = XmlUtils.Int("owner_id");
                a.Title         = XmlUtils.String("title");
                a.CommentsCount = XmlUtils.Int("ncom");
                break;
            }

            case AttachmentType.Photo:
            {
                AttachmentPhoto a = new AttachmentPhoto();
                a.Id           = XmlUtils.Int("pid");
                a.OwnerId      = XmlUtils.Int("owner_id");
                a.PictureUrl   = XmlUtils.String("src_big");
                a.ThumbnailUrl = XmlUtils.String("src");
                return(a);

                break;
            }

            case AttachmentType.PostedPhoto:
            {
                AttachmentPhoto a = new AttachmentPhoto();
                a.Id           = XmlUtils.Int("pid");
                a.OwnerId      = XmlUtils.Int("owner_id");
                a.PictureUrl   = XmlUtils.String("src_big");
                a.ThumbnailUrl = XmlUtils.String("src");
                return(a);

                break;
            }

            case AttachmentType.Poll:
            {
                AttachmentPoll a = new AttachmentPoll();
                a.Question = XmlUtils.String("question");
                return(a);

                break;
            }

            case AttachmentType.Share:
            {
                break;
            }

            case AttachmentType.Video:
            {
                AttachmentVideo a = new AttachmentVideo();
                a.Id       = XmlUtils.Int("vid");
                a.OwnerId  = XmlUtils.Int("owner_id");
                a.Title    = XmlUtils.String("title");
                a.Duration = XmlUtils.Int("duration");
                return(a);

                break;
            }

            case AttachmentType.Url:
            {
                AttachmentUrl a = new AttachmentUrl();
                a.Url          = XmlUtils.String("url");
                a.Title        = XmlUtils.String("title");
                a.Description  = XmlUtils.String("description");
                a.ThumbnailUrl = XmlUtils.String("image_src");
                break;
            }
            }
            return(null);
        }