public WsAttachment(Attachment attachment, WsAttachments parent) { Id = Guid.NewGuid(); _parent = parent; _attachment = attachment; InitializeAttachment(); }
public WsMailItem(MailItem mailItem) : base(mailItem) { _wsAttachments = new WsAttachments(_item.Attachments, this); ((MailItem)_item).BeforeAttachmentRead += OnBeforeAttachmentRead; ((MailItem)_item).AttachmentAdd += OnAttachmentAdd; ((MailItem)_item).AttachmentRemove += OnAttachmentRemove; ((MailItem)_item).BeforeCheckNames += OnBeforeCheckNames; }
protected override void Dispose(bool disposing) { if (_item != null) { ((MailItem) (_item)).BeforeAttachmentRead -= OnBeforeAttachmentRead; ((MailItem) _item).AttachmentAdd -= OnAttachmentAdd; ((MailItem) _item).AttachmentRemove -= OnAttachmentRemove; ((MailItem) _item).BeforeCheckNames -= OnBeforeCheckNames; } if (_recipients != null) { _recipients.Dispose(); _recipients = null; } if (_wsAttachments != null) { _wsAttachments.Dispose(); _wsAttachments = null; } if (_wsInspector != null) { _wsInspector.Dispose(); _wsInspector = null; } if (_wsAccount != null) { _wsAccount.Dispose(); _wsAccount = null; } if (_wsApplication != null) { _wsApplication.Dispose(); _wsApplication = null; } if (_wsUserProperties != null) { _wsUserProperties.Dispose(); _wsUserProperties = null; } if (_wsPropertyAccessor != null) { _wsPropertyAccessor.Dispose(); _wsPropertyAccessor = null; } if (_wsSession != null) { _wsSession.Dispose(); _wsSession = null; } base.Dispose(disposing); }