private void LoadEmailContent(LotusNotesWrapper wrapper) { var convertEmailToRichText = wrapper.ConvertEmailToRichText; try { wrapper.ConvertEmailToRichText = false; HasMime = document.HasItem("$NoteHasNativeMIME"); if (HasMime) { ContentHtml = GetMimeContent("text/html"); ContentText = GetMimeContent("text/plain"); } } finally { wrapper.ConvertEmailToRichText = convertEmailToRichText; } if (string.IsNullOrEmpty(ContentText)) { var noteItem = GetNoteItems().FirstOrDefault(i => i.Name == ItemFieldNames.Body); ContentText = noteItem == null ? null : new DocumentItemModel(noteItem).Value; } }
public DocumentModel(LotusNotesWrapper wrapper, NotesDocument document) { this.document = document; LoadEmailContent(wrapper); Authors = ((IEnumerable)document.Authors).Cast <string>().ToArray(); Created = document.Created; EmbeddedObjects = document.EmbeddedObjects; HasEmbedded = document.HasEmbedded; HttpURL = document.HttpURL; IsDeleted = document.IsDeleted; IsNewNote = document.IsNewNote; IsProfile = document.IsProfile; IsResponse = document.IsResponse; IsSigned = document.IsSigned; IsUIDocOpen = document.IsUIDocOpen; IsValid = document.IsValid; Key = document.Key; LastAccessed = document.LastAccessed; LastModified = document.LastModified; NameOfProfile = document.NameOfProfile; NoteID = document.NoteID; NotesURL = document.NotesURL; ParentView = document.ParentView; Responses = document.Responses; SentByAgent = document.SentByAgent; Signer = document.Signer; SignOnSend = document.SignOnSend; Size = document.Size; Unid = document.UniversalID; IsEncrypted = document.IsEncrypted; Items = new Lazy <DocumentItemModel[]>(() => GetItems(document)); Subject = document.GetItemValue(ItemFieldNames.Subject)[0]; From = document.GetItemValue(ItemFieldNames.From).ToString(); To = ((IEnumerable)document.GetItemValue(ItemFieldNames.SendTo)).Cast <string>().ToArray(); Cc = ((IEnumerable)document.GetItemValue(ItemFieldNames.CopyTo)).Cast <string>().ToArray(); }
public DatabaseModel(LotusNotesWrapper wrapper, NotesDatabase database) { this.wrapper = wrapper ?? throw new ArgumentNullException(nameof(wrapper)); this.database = database ?? throw new ArgumentNullException(nameof(database)); }