String() public static method

Gets the string value from node
public static String ( string nodeName ) : string
nodeName string node
return string
Beispiel #1
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);
        }
Beispiel #2
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);
        }