using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Nuclex.Networking.Gallery3 { /// Represents an movie, photograph, painting or rendered image public class Visual : Entity { /// Initializes a new gallery item /// /// Connection holding the resources needed to issue requests to /// the gallery installation /// /// /// The JSON data returned by the gallery REST API about this entity /// internal Visual(IGalleryConnection connection, ref Responses.JsonItem jsonItem) : base(connection, ref jsonItem) { } /// Time the image or video was captured by the camera /// /// Not all items will have this item set. Some images or videos were not captured /// but created (think paintings and CG movies) and gallery might not be able to /// read this data from some formats even if it is there. /// public DateTime? CaptureDate { get { lock (this) { if (base.jsonItem.Entity.Captured.HasValue) { return DateTimeHelper.DateTimeFromGalleryTime(base.jsonItem.Entity.Captured.Value); } else { return null; } } } } /// The image or video's width, if known to gallery /// /// Depending on the format of the item, gallery may not always be able to /// provide this value. /// public int? Width { get { lock (this) { if (base.jsonItem.Entity.Width.HasValue) { return base.jsonItem.Entity.Width.Value; } else { return null; } } } } /// The image or video's height, if known to gallery /// /// Depending on the format of the item, gallery may not always be able to /// provide this value. /// public int? Height { get { lock (this) { if (base.jsonItem.Entity.Height.HasValue) { return base.jsonItem.Entity.Height.Value; } else { return null; } } } } } } // namespace Nuclex.Networking.Gallery3