A set context for a photo.
コード例 #1
0
ファイル: Context.cs プロジェクト: MichaelAzar/flickr-net
 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);
		}