Returns a wrapper for the specified MimeAttachmentList ensuring that all elements are unique.
A wrapper around collection ensuring that all elements are unique.
The Unique wrapper provides a set-like collection by ensuring that all elements in the MimeAttachmentList are unique.
Unique raises an ArgumentException if the specified collection contains any duplicate elements. The returned wrapper raises a NotSupportedException whenever the user attempts to add an element that is already contained in the MimeAttachmentList.
Note: The Unique wrapper reflects any changes made to the underlying collection, including the possible creation of duplicate elements. The uniqueness of all elements is therefore no longer assured if the underlying collection is manipulated directly.
Exception Type | Condition |
---|---|
ArgumentException | collection contains duplicate elements. |
ArgumentNullException | collection is a null reference. |
MimeAttachmentList Class | SmtPop Namespace