OutlookCategoryCollection
OfficeIMO.Email
Mutable Outlook category names with case-insensitive convenience operations.
Inheritance
- object
- OutlookCategoryCollection
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Property EmailMessageMetadata.Categories
Constructors
public OutlookCategoryCollection() #Methods
public void Add(string item) #Adds an item to the ICollection<T>.
Parameters
- item string
- The object to add to the ICollection<T>.
Exceptions
NotSupportedException– The ICollection<T> is read-only.
public bool AddIfMissing(string category) #Adds a non-empty category unless an equivalent name already exists.
Parameters
- category string
Returns
bool true when the category was added.public void Clear() #Removes all items from the ICollection<T>.
Exceptions
NotSupportedException– The ICollection<T> is read-only.
public bool Contains(string category, StringComparer comparer) #Returns whether the collection contains a category using the requested comparison.
Parameters
- category string
- comparer System.StringComparer
Returns
boolpublic bool Contains(string item) #Determines whether the ICollection<T> contains a specific value.
Parameters
- item string
- The object to locate in the ICollection<T>.
Returns
bool true if item is found in the ICollection<T>; otherwise, false.public void CopyTo(string[] array, int arrayIndex) #Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Parameters
- array string[]
- The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
- arrayIndex int
- The zero-based index in array at which copying begins.
Exceptions
ArgumentNullException– array is null.ArgumentOutOfRangeException– arrayIndex is less than 0.ArgumentException– The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.
public IEnumerator<string> GetEnumerator() #Returns an enumerator that iterates through the collection.
Returns
IEnumerator<string> An enumerator that can be used to iterate through the collection.public int IndexOf(string item) #Determines the index of a specific item in the IList<T>.
Parameters
- item string
- The object to locate in the IList<T>.
Returns
int The index of item if found in the list; otherwise, -1.public void Insert(int index, string item) #Inserts an item to the IList<T> at the specified index.
Parameters
- index int
- The zero-based index at which item should be inserted.
- item string
- The object to insert into the IList<T>.
Exceptions
ArgumentOutOfRangeException– index is not a valid index in the IList<T>.NotSupportedException– The IList<T> is read-only.
public bool Remove(string item) #Removes the first occurrence of a specific object from the ICollection<T>.
Parameters
- item string
- The object to remove from the ICollection<T>.
Returns
bool true if item was successfully removed from the ICollection<T>; otherwise, false. This method also returns false if item is not found in the original ICollection<T>.Exceptions
NotSupportedException– The ICollection<T> is read-only.
public int RemoveAll(string category) #Removes every category matching the supplied name case-insensitively.
Parameters
- category string
Returns
int The number of removed category entries.public void RemoveAt(int index) #Removes the IList<T> item at the specified index.
Parameters
- index int
- The zero-based index of the item to remove.
Exceptions
ArgumentOutOfRangeException– index is not a valid index in the IList<T>.NotSupportedException– The IList<T> is read-only.
public void ReplaceWith(IEnumerable<string> categories, bool removeDuplicates = true) #Replaces the collection, optionally removing case-insensitive duplicates.
Parameters
- categories System.Collections.Generic.IEnumerable<string>
- removeDuplicates bool = true
Inherited Methods
Properties
public int Count { get; } #Gets the number of elements contained in the ICollection<T>.
public bool IsReadOnly { get; } #Gets a value indicating whether the ICollection<T> is read-only.
public string this[int index] { get; set; } #Gets or sets the element at the specified index.
Parameters
- index int
- The zero-based index of the element to get or set.
Exceptions
ArgumentOutOfRangeException– index is not a valid index in the IList<T>.NotSupportedException– The property is set and the IList<T> is read-only.