using System; using System.Xml.Serialization; using System.Xml.Schema; namespace FlickrNet { /// /// The class contains details returned by the /// method. /// [System.Serializable] public class Person { /// The user id of the user. /// [XmlAttribute("nsid", Form=XmlSchemaForm.Unqualified)] public string UserId; /// Is the user an administrator. /// 1 = admin, 0 = normal user. /// [XmlAttribute("isadmin", Form=XmlSchemaForm.Unqualified)] public int IsAdmin; /// Does the user posses a pro account. /// 0 = free acouunt, 1 = pro account holder. [XmlAttribute("ispro", Form=XmlSchemaForm.Unqualified)] public int IsPro; /// Does the user posses a pro account. /// 0 = free acouunt, 1 = pro account holder. [XmlAttribute("iconserver", Form=XmlSchemaForm.Unqualified)] public int IconServer; /// The users username, also known as their screenname. [XmlElement("username", Form=XmlSchemaForm.Unqualified)] public string UserName; /// The users real name, as entered in their profile. [XmlElement("realname", Form=XmlSchemaForm.Unqualified)] public string RealName; /// Consists of your current location followed by country. /// e.g. Newcastle, UK. [XmlElement("location", Form=XmlSchemaForm.Unqualified)] public string Location; /// Sub element containing a summary of the users photo information. /// [XmlElement("photos", Form=XmlSchemaForm.Unqualified)] public PersonPhotosSummary PhotosSummary; /// /// The users photo location on Flickr /// http://www.flickr.com/photos/username/ /// [XmlElement("photosurl",Form=XmlSchemaForm.Unqualified)] public string PhotosUrl; /// /// The users profile location on Flickr /// http://www.flickr.com/people/username/ /// [XmlElement("profileurl",Form=XmlSchemaForm.Unqualified)] public string ProfileUrl; /// /// Returns the for the users Buddy Icon. /// [XmlIgnore()] public Uri BuddyIconUrl { get { if( IconServer == 0 ) return new Uri("http://www.flickr.com/images/buddyicon.jpg"); else return new Uri(String.Format("http://static.flickr.com/{0}/buddyicons/{1}.jpg", IconServer, UserId)); } } } /// /// A summary of a users photos. /// [System.Serializable] public class PersonPhotosSummary { /// The first date the user uploaded a picture, converted into format. [XmlIgnore()] public DateTime FirstDate { get { return Utils.UnixTimestampToDate(firstdate_raw); } } /// The first date the user took a picture, converted into format. [XmlIgnore()] public DateTime FirstTakenDate { get { return Utils.UnixTimestampToDate(firsttakendate_raw); } } /// The total number of photos for the user. /// [XmlElement("count", Form=XmlSchemaForm.Unqualified)] public int PhotoCount; /// The unix timestamp of the date the first photo was uploaded. [XmlElement("firstdate", Form=XmlSchemaForm.Unqualified)] public string firstdate_raw; /// The unix timestamp of the date the first photo was uploaded. [XmlElement("firsttakendate", Form=XmlSchemaForm.Unqualified)] public string firsttakendate_raw; } }