Simple Mail and Post Office Protocol for .Net (SmtPop)

MimeAttachmentList.Unique Method 

Returns a wrapper for the specified MimeAttachmentList ensuring that all elements are unique.

public static MimeAttachmentList Unique(
   MimeAttachmentList collection
);

Parameters

collection
The MimeAttachmentList to wrap.

Return Value

A wrapper around collection ensuring that all elements are unique.

Remarks

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.

Exceptions

Exception Type Condition
ArgumentException collection contains duplicate elements.
ArgumentNullException collection is a null reference.

See Also

MimeAttachmentList Class | SmtPop Namespace