File: PhotoDates.cs

package info (click to toggle)
libflickrnet 25277-6
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 628 kB
  • ctags: 1,355
  • sloc: cs: 7,136; makefile: 24; sh: 13; ansic: 6
file content (68 lines) | stat: -rw-r--r-- 1,757 bytes parent folder | download | duplicates (2)
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
using System;
using System.Xml.Serialization;
using System.Xml.Schema;

namespace FlickrNet
{
	/// <summary>
	/// The date information for a photo.
	/// </summary>
	[System.Serializable]
	public class PhotoDates
	{
		/// <summary>
		/// The date the photo was posted (or uploaded).
		/// </summary>
		[XmlIgnore]
		public DateTime PostedDate
		{
			get { return Utils.UnixTimestampToDate(raw_posted); }
		}

		/// <summary>
		/// The raw timestamp for the date the photo was posted.
		/// </summary>
		/// <remarks>Use <see cref="PhotoDates.PostedDate"/> instead.</remarks>
		[XmlAttribute("posted", Form=XmlSchemaForm.Unqualified)]
		public long raw_posted;

		/// <summary>
		/// The date the photo was taken.
		/// </summary>
		[XmlIgnore]
		public DateTime TakenDate
		{
			get { return DateTime.Parse(raw_taken); }
		}

		/// <summary>
		/// The raw timestamp for the date the photo was taken.
		/// </summary>
		/// <remarks>Use <see cref="PhotoDates.TakenDate"/> instead.</remarks>
		[XmlAttribute("taken", Form=XmlSchemaForm.Unqualified)]
		public string raw_taken;

		/// <summary>
		/// The granularity of the taken date.
		/// </summary>
		[XmlAttribute("takengranularity", Form=XmlSchemaForm.Unqualified)]
		public int TakenGranularity;

		/// <summary>
		/// The raw timestamp for the date the photo was last updated.
		/// </summary>
		[XmlAttribute("lastupdate", Form=XmlSchemaForm.Unqualified)]
		public long raw_lastupdate;

		/// <summary>
		/// The date the photo was last updated (includes comments, tags, title, description etc).
		/// </summary>
		[XmlIgnore()]
		public DateTime LastUpdated
		{
			get{ return Utils.UnixTimestampToDate(raw_lastupdate); }
		}

	}

}