-
Notifications
You must be signed in to change notification settings - Fork 0
/
FavoriteContext.cs
50 lines (44 loc) · 1.64 KB
/
FavoriteContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Type: FlickrNet.FavoriteContext
// Assembly: FlickrNet, Version=3.10.0.0, Culture=neutral, PublicKeyToken=2491df59efa5d132
// MVID: 8B8C756F-D5B2-4047-8A8B-B1C1E877A2EF
// Assembly location: D:\RMCK\vs\2014.05.24_FlickrAPI\FlickrNet.dll
using System.Collections.ObjectModel;
using System.Xml;
namespace FlickrNet
{
public sealed class FavoriteContext : IFlickrParsable
{
public int Count { get; set; }
public Collection<FavoriteContextPhoto> PreviousPhotos { get; set; }
public Collection<FavoriteContextPhoto> NextPhotos { get; set; }
public FavoriteContext()
{
this.PreviousPhotos = new Collection<FavoriteContextPhoto>();
this.NextPhotos = new Collection<FavoriteContextPhoto>();
}
void IFlickrParsable.Load(XmlReader reader)
{
if (reader.LocalName != "count" && !reader.ReadToFollowing("count"))
return;
this.Count = reader.ReadElementContentAsInt();
if (reader.LocalName != "prevphotos")
reader.ReadToFollowing("prevphotos");
reader.ReadToDescendant("photo");
while (reader.LocalName == "photo")
{
FavoriteContextPhoto favoriteContextPhoto = new FavoriteContextPhoto();
favoriteContextPhoto.Load(reader);
this.PreviousPhotos.Add(favoriteContextPhoto);
}
if (reader.LocalName != "nextphotos")
reader.ReadToFollowing("nextphotos");
reader.ReadToDescendant("photo");
while (reader.LocalName == "photo")
{
FavoriteContextPhoto favoriteContextPhoto = new FavoriteContextPhoto();
favoriteContextPhoto.Load(reader);
this.NextPhotos.Add(favoriteContextPhoto);
}
}
}
}