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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
using System.Xml.Serialization;
using System.Xml.Schema;
namespace FlickrNet
{
/// <summary>
/// Collection containing a users photosets.
/// </summary>
[System.Serializable]
public class Photosets
{
private int _canCreate;
private Photoset[] _photosetCollection = new Photoset[0];
/// <summary>
/// Can the user create more photosets.
/// </summary>
/// <remarks>
/// 1 meants yes, 0 means no.
/// </remarks>
[XmlAttribute("cancreate", Form=XmlSchemaForm.Unqualified)]
public int CanCreate
{
get { return _canCreate; }
set { _canCreate = value; }
}
/// <summary>
/// An array of <see cref="Photoset"/> objects.
/// </summary>
[XmlElement("photoset", Form=XmlSchemaForm.Unqualified)]
public Photoset[] PhotosetCollection
{
get { return _photosetCollection; }
set
{
if( value== null )
_photosetCollection = new Photoset[0];
else
_photosetCollection = value;
}
}
}
/// <summary>
/// A set of properties for the photoset.
/// </summary>
[System.Serializable]
public class Photoset
{
private string _photosetId;
private string _url;
private string _ownerId;
private string _primaryPhotoId;
private string _secret;
private string _server;
private string _farm;
private int _numberOfPhotos;
private string _title;
private string _description;
private Photo[] _photoCollection = new Photo[0];
/// <summary>
/// The ID of the photoset.
/// </summary>
[XmlAttribute("id", Form=XmlSchemaForm.Unqualified)]
public string PhotosetId
{
get { return _photosetId; } set { _photosetId = value; }
}
/// <summary>
/// The URL of the photoset.
/// </summary>
[XmlAttribute("url", Form=XmlSchemaForm.Unqualified)]
public string Url
{
get { return _url; } set { _url = value; }
}
/// <summary>
/// The ID of the owner of the photoset.
/// </summary>
[XmlAttribute("owner", Form=XmlSchemaForm.Unqualified)]
public string OwnerId
{
get { return _ownerId; } set { _ownerId = value; }
}
/// <summary>
/// The photo ID of the primary photo of the photoset.
/// </summary>
[XmlAttribute("primary", Form=XmlSchemaForm.Unqualified)]
public string PrimaryPhotoId
{
get { return _primaryPhotoId; } set { _primaryPhotoId = value; }
}
/// <summary>
/// The secret for the primary photo for the photoset.
/// </summary>
[XmlAttribute("secret", Form=XmlSchemaForm.Unqualified)]
public string Secret
{
get { return _secret; } set { _secret = value; }
}
/// <summary>
/// The server for the primary photo for the photoset.
/// </summary>
[XmlAttribute("server", Form=XmlSchemaForm.Unqualified)]
public string Server
{
get { return _server; } set { _server = value; }
}
/// <summary>
/// The server farm for the primary photo for the photoset.
/// </summary>
[XmlAttribute("farm", Form=XmlSchemaForm.Unqualified)]
public string Farm
{
get { return _farm; } set { _farm = value; }
}
/// <summary>
/// The number of photos in the photoset.
/// </summary>
[XmlAttribute("photos", Form=XmlSchemaForm.Unqualified)]
public int NumberOfPhotos
{
get { return _numberOfPhotos; } set { _numberOfPhotos = value; }
}
/// <summary>
/// The title of the photoset.
/// </summary>
[XmlElement("title", Form=XmlSchemaForm.Unqualified)]
public string Title
{
get { return _title; } set { _title = value; }
}
/// <summary>
/// The description of the photoset.
/// </summary>
[XmlElement("description", Form=XmlSchemaForm.Unqualified)]
public string Description
{
get { return _description; } set { _description = value; }
}
/// <summary>
/// An array of photo objects in the photoset.
/// </summary>
[XmlElement("photo", Form=XmlSchemaForm.Unqualified)]
public Photo[] PhotoCollection
{
get { return _photoCollection; }
set
{
if( value == null )
_photoCollection = new Photo[0];
else
_photoCollection = value;
}
}
/// <summary>
/// The URL for the thumbnail of a photo.
/// </summary>
[XmlIgnore()]
public string PhotosetThumbnailUrl
{
get { return Utils.UrlFormat(this, "_t", "jpg"); }
}
/// <summary>
/// The URL for the square thumbnail of a photo.
/// </summary>
[XmlIgnore()]
public string PhotosetSquareThumbnailUrl
{
get { return Utils.UrlFormat(this, "_s", "jpg"); }
}
/// <summary>
/// The URL for the small copy of a photo.
/// </summary>
[XmlIgnore()]
public string PhotosetSmallUrl
{
get { return Utils.UrlFormat(this, "_m", "jpg"); }
}
}
}
|