示例#1
0
 public bool parse(XElement xml)
 {
     foreach (XElement element in xml.Elements())
     {
         if (!TimeLineObject.empty(element))
         {
             if (element.Name == "contentStyle")
             {
                 this.nStyle = (int)element;
             }
             else if (element.Name == "title")
             {
                 this.strTitle = (string)element;
             }
             else if (element.Name == "description")
             {
                 this.strDescription = (string)element;
             }
             else if (element.Name == "mediaList")
             {
                 this.parseMediaList(element);
             }
             else if (element.Name == "contentUrl")
             {
                 this.strContentUrl = (string)element;
             }
         }
     }
     return(true);
 }
示例#2
0
        public override void merge(object o)
        {
            SnsInfo info = o as SnsInfo;

            if (info != null)
            {
                this.nCheckSum             = info.nCheckSum;
                this.nStatus               = info.nStatus;
                this.nObjectStyle          = info.nObjectStyle;
                this.strObjectID           = info.strObjectID;
                this.strUserName           = info.strUserName;
                this.strNickName           = info.strNickName;
                this.nCreateTime           = info.nCreateTime;
                this.nLikeFlag             = info.nLikeFlag;
                this.nExtFlag              = info.nExtFlag;
                this.nLikeCount            = info.nLikeCount;
                this.nCommentCount         = info.nCommentCount;
                this.nWithUserCount        = info.nWithUserCount;
                this.bytesXmlLikeList      = info.bytesXmlLikeList;
                this.bytesXmlCommnetList   = info.bytesXmlCommnetList;
                this.bytesXmlWithList      = info.bytesXmlWithList;
                this.bytesObjectDesc       = info.bytesObjectDesc;
                this.bytesXmlGroupList     = info.bytesXmlGroupList;
                this.bytesXmlGroupUserList = info.bytesXmlGroupUserList;
                this.bytesXmlBlackList     = info.bytesXmlBlackList;
                this._likeList             = null;
                this._commentList          = null;
                this._withList             = null;
                this._groupList            = null;
                this.timeLine              = null;
            }
        }
示例#3
0
 public bool parse(XElement xml)
 {
     foreach (XElement element in xml.Elements())
     {
         if (!TimeLineObject.empty(element))
         {
             if (element.Name == "id")
             {
                 this.nID = (ulong)element;
             }
             else if (element.Name == "type")
             {
                 this.nType = (int)element;
             }
             else if (element.Name == "title")
             {
                 this.strTitle = (string)element;
             }
             else if (element.Name == "description")
             {
                 this.strDescription = (string)element;
             }
             else if (element.Name == "private")
             {
                 this.nPrivate = (int)element;
             }
             else if (element.Name == "url")
             {
                 this.strUrl   = (string)element;
                 this.nUrlType = (int)element.Attribute("type");
             }
             else if (element.Name == "thumb")
             {
                 this.strThumb   = (string)element;
                 this.nThumbType = (int)element.Attribute("type");
             }
             else if (element.Name == "size")
             {
                 foreach (XAttribute attribute in element.Attributes())
                 {
                     if (attribute.Name == "width")
                     {
                         this.nWidth = (float)element.Attribute("width");
                     }
                     else if (attribute.Name == "height")
                     {
                         this.nHeight = (float)element.Attribute("height");
                     }
                     else if (attribute.Name == "nTotalSize")
                     {
                         this.nTotalSize = (float)element.Attribute("totalSize");
                     }
                 }
             }
         }
     }
     return(true);
 }
示例#4
0
        public static TimeLineObject ParseFrom(byte[] bytesXmlData)
        {
            TimeLineObject obj2 = new TimeLineObject();

            if (obj2.Parse(bytesXmlData))
            {
                return(obj2);
            }
            return(null);
        }
示例#5
0
 public TimeLineObject getTimeLine()
 {
     if (this.timeLine == null)
     {
         this.timeLine = TimeLineObject.ParseFrom(this.bytesObjectDesc);
         if (this.timeLine == null)
         {
             Log.e("SnsInfo", "parse xml error sns obj id=" + this.nObjectID);
             TimeLineObject.dumpXmlData(this.bytesObjectDesc);
         }
     }
     return(this.timeLine);
 }
示例#6
0
 public void setTimeLine(TimeLineObject tl)
 {
     this.bytesObjectDesc = tl.toXmlData();
     this.timeLine        = tl;
 }