using System.Globalization; using System; namespace JWLMerge.BackupFileServices.Models.DatabaseModels; public class Note { /// /// The note identifier. /// public int NoteId { get; set; } /// /// A Guid (that should assist in merging notes). /// #pragma warning disable CA1720 // Identifier contains type name public string Guid { get; set; } = null!; #pragma warning restore CA1720 // Identifier contains type name /// /// The user mark identifier (if the note is associated with user-highlighting). /// A reference to UserMark.UserMarkId /// public int? UserMarkId { get; set; } /// /// The location identifier (if the note is associated with a location - which it usually is) /// public int? LocationId { get; set; } /// /// The user-defined note title. /// public string? Title { get; set; } /// /// The user-defined note content. /// public string? Content { get; set; } /// /// Time stamp when the note was last edited. ISO 8601 format. /// public string? LastModified { get; set; } /// /// The type of block associated with the note. /// Valid values are possibly 0, 1, and 2. /// Best guess at semantics: /// 0 = The note is associated with the document rather than a block of text within it. /// 1 = The note is associated with a paragraph in a publication. /// 2 = The note is associated with a verse in the Bible. /// In all cases, see also the UserMarkId which may better define the associated block of text. /// public int BlockType { get; set; } /// /// The block identifier. Helps to locate the block of text associated with the note. /// If the BlockType is 1 (a publication), then BlockIdentifier denotes the paragraph number. /// If the BlockType is 2 (the Bible), then BlockIdentifier denotes the verse number. /// public int? BlockIdentifier { get; set; } public DateTime GetLastModifiedDateTime() { if (string.IsNullOrWhiteSpace(LastModified)) { return DateTime.Now; } return DateTime.Parse(LastModified, CultureInfo.InvariantCulture); } public Note Clone() { return (Note)MemberwiseClone(); } }