| | 1 | | namespace Songhay.Models; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Defines a managed representation of the OPML head element. |
| | 5 | | /// </summary> |
| | 6 | | [Serializable] |
| | 7 | | [XmlRoot(ElementName = "head")] |
| | 8 | | [DataContract(Name = "head")] |
| | 9 | | public class OpmlHead |
| | 10 | | { |
| | 11 | | /// <summary> |
| | 12 | | /// Initializes a new instance of the <see cref="OpmlHead"/> class. |
| | 13 | | /// </summary> |
| 5 | 14 | | public OpmlHead() |
| 5 | 15 | | { |
| 5 | 16 | | DateCreated = DateTime.Now; |
| 5 | 17 | | DateModified = DateTime.Now; |
| 5 | 18 | | } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Gets or sets the title. |
| | 22 | | /// </summary> |
| | 23 | | [XmlElement(ElementName = "title")] |
| | 24 | | [JsonPropertyName("title")] |
| 7 | 25 | | public string? Title { get; set; } |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// Gets or sets the date created. |
| | 29 | | /// </summary> |
| | 30 | | [XmlIgnore] |
| | 31 | | [JsonIgnore] |
| | 32 | | public DateTime? DateCreated |
| | 33 | | { |
| 0 | 34 | | get => _dateCreated; |
| | 35 | | set |
| 10 | 36 | | { |
| 10 | 37 | | _dateCreated = value; |
| 10 | 38 | | DateCreatedString = value.HasValue ? ProgramTypeUtility.ConvertDateTimeToRfc822DateTime(value.Value) : null; |
| 10 | 39 | | } |
| | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Gets the date created string. |
| | 44 | | /// </summary> |
| | 45 | | [XmlElement(ElementName = "dateCreated")] |
| | 46 | | [JsonPropertyName("dateCreated")] |
| 11 | 47 | | public string? DateCreatedString { get; set; } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// Gets or sets the date modified. |
| | 51 | | /// </summary> |
| | 52 | | [XmlIgnore] |
| | 53 | | [JsonIgnore] |
| | 54 | | public DateTime? DateModified |
| | 55 | | { |
| 1 | 56 | | get => _dateModified; |
| | 57 | | set |
| 11 | 58 | | { |
| 11 | 59 | | _dateModified = value; |
| 11 | 60 | | DateModifiedString = |
| 11 | 61 | | value.HasValue ? ProgramTypeUtility.ConvertDateTimeToRfc822DateTime(value.Value) : null; |
| 11 | 62 | | } |
| | 63 | | } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Gets the date created string. |
| | 67 | | /// </summary> |
| | 68 | | [XmlElement(ElementName = "dateModified")] |
| | 69 | | [JsonPropertyName("dateModified")] |
| 12 | 70 | | public string? DateModifiedString { get; set; } |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Gets or sets the name of the owner. |
| | 74 | | /// </summary> |
| | 75 | | [XmlElement(ElementName = "ownerName")] |
| | 76 | | [JsonPropertyName("ownerName")] |
| 6 | 77 | | public string? OwnerName { get; set; } |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// Gets or sets the owner email. |
| | 81 | | /// </summary> |
| | 82 | | [XmlElement(ElementName = "ownerEmail")] |
| | 83 | | [JsonPropertyName("ownerEmail")] |
| 6 | 84 | | public string? OwnerEmail { get; set; } |
| | 85 | |
|
| | 86 | | DateTime? _dateCreated; |
| | 87 | | DateTime? _dateModified; |
| | 88 | | } |