Holds details of a sub category, including its id, name and the number of groups in it.
Inheritance: IFlickrParsable
示例#1
0
 void IFlickrParsable.Load(XmlReader reader)
 {
     if (!(reader.LocalName != "category"))
     ;
       while (reader.MoveToNextAttribute())
       {
     switch (reader.LocalName)
     {
       case "name":
     this.CategoryName = reader.Value;
     continue;
       case "path":
     this.Path = reader.Value;
     continue;
       case "pathids":
     this.PathIds = reader.Value;
     continue;
       default:
     continue;
     }
       }
       reader.Read();
       while (reader.LocalName == "subcat" || reader.LocalName == "group")
       {
     if (reader.LocalName == "subcat")
     {
       Subcategory subcategory = new Subcategory();
       subcategory.Load(reader);
       this.Subcategories.Add(subcategory);
     }
     else
     {
       Group group = new Group();
       ((IFlickrParsable) group).Load(reader);
       this.Groups.Add(group);
     }
       }
       reader.Skip();
 }
示例#2
0
        void IFlickrParsable.Load(System.Xml.XmlReader reader)
        {
            if (reader.LocalName != "category")
                UtilityMethods.CheckParsingException(reader);

            while (reader.MoveToNextAttribute())
            {
                switch (reader.LocalName)
                {
                    case "name":
                        CategoryName = reader.Value;
                        break;
                    case "path":
                        Path = reader.Value;
                        break;
                    case "pathids":
                        PathIds = reader.Value;
                        break;
                    default:
                        UtilityMethods.CheckParsingException(reader);
                        break;

                }
            }

            reader.Read();

            while (reader.LocalName == "subcat" || reader.LocalName == "group")
            {
                if (reader.LocalName == "subcat")
                {
                    Subcategory c = new Subcategory();
                    ((IFlickrParsable)c).Load(reader);
                    Subcategories.Add(c);

                }
                else
                {
                    Group s = new Group();
                    ((IFlickrParsable)s).Load(reader);
                    Groups.Add(s);
                }
            }

            // Skip to next element (if any)
            reader.Skip();
        }