A set context for a photo.
예제 #1
0
 void IFlickrParsable.Load(XmlReader reader)
 {
     while (reader.NodeType != XmlNodeType.EndElement)
     {
         switch (reader.LocalName)
         {
             case "set":
                 ContextSet set = new ContextSet();
                 set.PhotosetId = reader.GetAttribute("id");
                 set.Title = reader.GetAttribute("title");
                 Sets.Add(set);
                 reader.Read();
                 break;
             case "pool":
                 ContextGroup group = new ContextGroup();
                 group.GroupId = reader.GetAttribute("id");
                 group.Title = reader.GetAttribute("title");
                 Groups.Add(group);
                 reader.Read();
                 break;
             default:
                 break;
         }
     }
 }
예제 #2
0
        void IFlickrParsable.Load(XmlReader reader)
        {
            while (reader.NodeType != XmlNodeType.EndElement)
            {
                switch (reader.LocalName)
                {
                case "set":
                    var set = new ContextSet();
                    set.PhotosetId = reader.GetAttribute("id");
                    set.Title      = reader.GetAttribute("title");
                    Sets.Add(set);
                    reader.Read();
                    break;

                case "pool":
                    var group = new ContextGroup();
                    group.GroupId = reader.GetAttribute("id");
                    group.Title   = reader.GetAttribute("title");
                    Groups.Add(group);
                    reader.Read();
                    break;

                default:
                    break;
                }
            }
        }
예제 #3
0
        internal AllContexts(XmlElement[] elements)
        {
            ArrayList sets   = new ArrayList();
            ArrayList groups = new ArrayList();

            foreach (XmlElement element in elements)
            {
                if (element.Name == "set")
                {
                    ContextSet aset = new ContextSet();
                    aset.PhotosetId = element.Attributes["id"].Value;
                    aset.Title      = element.Attributes["title"].Value;
                    sets.Add(aset);
                }

                if (element.Name == "pool")
                {
                    ContextGroup agroup = new ContextGroup();
                    agroup.GroupId = element.Attributes["id"].Value;
                    agroup.Title   = element.Attributes["title"].Value;
                    groups.Add(agroup);
                }
            }

            _sets = new ContextSet[sets.Count];
            sets.CopyTo(_sets);

            _groups = new ContextGroup[groups.Count];
            groups.CopyTo(_groups);
        }
예제 #4
0
		internal AllContexts(XmlElement[] elements)
		{
			ArrayList sets = new ArrayList();
			ArrayList groups = new ArrayList();

			foreach(XmlElement element in elements)
			{
				if( element.Name == "set" )
				{
					ContextSet aset = new ContextSet();
					aset.PhotosetId = element.Attributes["id"].Value;
					aset.Title = element.Attributes["title"].Value;
					sets.Add(aset);
				}

				if( element.Name == "pool" )
				{
					ContextGroup agroup = new ContextGroup();
					agroup.GroupId = element.Attributes["id"].Value;
					agroup.Title = element.Attributes["title"].Value;
					groups.Add(agroup);
				}
			}

			_sets = new ContextSet[sets.Count];
			sets.CopyTo(_sets);

			_groups = new ContextGroup[groups.Count];
			groups.CopyTo(_groups);
		}