/
Photo.cs
60 lines (53 loc) · 1.74 KB
/
Photo.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
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FlickrDL
{
// Represent a photo.
// Similar to FlickrNet.Photo, but
// - only has fields that I use
// - add properties:
// - PhotosetTitle
// - PhotosetId
//
// FlickNet.Photo is not sealed, so I could derive from it. But FlickrNet.Photo does not
// define a copy constructor, so there is no easy way to create a constructor for Photo that
// takes a FlickNet.Photo as a parameter.
public class Photo
{
public Photo()
{
OriginalSortOrder = -1;
}
public Photo(FlickrNet.Photo p) : this()
{
Title = p.Title;
Description = p.Description;
PhotoId = p.PhotoId;
Tags = p.Tags.ToList<string>();
DateTaken = p.DateTaken;
OwnerName = p.OwnerName;
OriginalUrl = p.OriginalUrl;
}
public Photo(FlickrNet.Photo p, Photoset ps) : this(p)
{
if (ps != null)
{
PhotosetTitle = ps.Title;
PhotosetId = ps.PhotosetId;
}
}
public int OriginalSortOrder { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string PhotoId { get; set; }
public List<string> Tags { get; set; }
public DateTime DateTaken { get; set; }
public string OwnerName { get; set; }
public string OriginalUrl { get; }
public string Location { get; set; }
public string PhotosetTitle { get; set; }
public string PhotosetId { get; set; }
}
}