Пример #1
0
        private List <PhotoEntryTag> buildPhotoTagsList(XmlNode result)
        {
            XmlNodeList nodes = result.SelectNodes("tag");

            if (nodes.Count > 0)
            {
                List <PhotoEntryTag> tags = new List <PhotoEntryTag>();
                foreach (XmlNode n in nodes)
                {
                    XmlUtils.UseNode(n);
                    PhotoEntryTag tag = new PhotoEntryTag();

                    /**
                     * <tag>
                     * <uid>5005272</uid>
                     * <tag_id>2859378</tag_id>
                     * <placer_id>5005272</placer_id>
                     * <tagged_name>Алексей Харьков</tagged_name>
                     * <date>1214309859</date>
                     * <x>8.98</x>
                     * <y>6.65</y>
                     * <x2>39.01</x2>
                     * <y2>64.45</y2>
                     * <viewed>1</viewed>
                     * </tag>
                     */
                    tag.Id       = XmlUtils.Int("tag_id");
                    tag.UserId   = XmlUtils.Int("uid");
                    tag.PlacerId = XmlUtils.Int("placer_id");
                    tag.Date     = CommonUtils.FromUnixTime(XmlUtils.Int("date"));
                    tag.X        = XmlUtils.Int("x");
                    tag.Y        = XmlUtils.Int("y");
                    tag.X2       = XmlUtils.Int("x2");
                    tag.Y2       = XmlUtils.Int("y2");
                    tag.Viewed   = XmlUtils.Int("viewed");
                    tags.Add(tag);
                }
                return(tags);
            }
            return(null);
        }
Пример #2
0
 private List<PhotoEntryTag> buildPhotoTagsList(XmlNode result)
 {
     XmlNodeList nodes = result.SelectNodes("tag");
     if (nodes.Count > 0)
     {
         List<PhotoEntryTag> tags = new List<PhotoEntryTag>();
         foreach (XmlNode n in nodes)
         {
             XmlUtils.UseNode(n);
             PhotoEntryTag tag = new PhotoEntryTag();
             /**
              * <tag>
               <uid>5005272</uid>
               <tag_id>2859378</tag_id>
               <placer_id>5005272</placer_id>
               <tagged_name>Алексей Харьков</tagged_name>
               <date>1214309859</date>
               <x>8.98</x>
               <y>6.65</y>
               <x2>39.01</x2>
               <y2>64.45</y2>
               <viewed>1</viewed>
              </tag>
              */
             tag.Id = XmlUtils.Int("tag_id");
             tag.UserId = XmlUtils.Int("uid");
             tag.PlacerId = XmlUtils.Int("placer_id");
             tag.Date = CommonUtils.FromUnixTime(XmlUtils.Int("date"));
             tag.X = XmlUtils.Int("x");
             tag.Y = XmlUtils.Int("y");
             tag.X2 = XmlUtils.Int("x2");
             tag.Y2 = XmlUtils.Int("y2");
             tag.Viewed = XmlUtils.Int("viewed");
             tags.Add(tag);
         }
         return tags;
     }
     return null;
 }