API Reference
OutlookCategoryCollection
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) #VoidAdds an item to the ICollection.
Parameters
- item System.String
- The object to add to the ICollection.
Exceptions
NotSupportedException– The ICollection is read-only.
public Boolean AddIfMissing(String category) #BooleanAdds a non-empty category unless an equivalent name already exists.
Parameters
- category System.String
Returns
true when the category was added.
public Void Clear() #VoidRemoves all items from the ICollection.
Exceptions
NotSupportedException– The ICollection is read-only.
public Boolean Contains(String category, StringComparer comparer) #BooleanReturns whether the collection contains a category using the requested comparison.
Parameters
- category System.String
- comparer System.StringComparer
public Boolean Contains(String item) #BooleanDetermines whether the ICollection contains a specific value.
Parameters
- item System.String
- The object to locate in the ICollection.
Returns
true if item is found in the ICollection; otherwise, false.
public Void CopyTo(String[] array, Int32 arrayIndex) #VoidCopies the elements of the ICollection to an Array, starting at a particular Array index.
Parameters
- array System.String[]
- The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing.
- arrayIndex System.Int32
- 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 is greater than the available space from arrayIndex to the end of the destination array.
public IEnumerator<String> GetEnumerator() #IEnumerator<String>Returns an enumerator that iterates through the collection.
Returns
An enumerator that can be used to iterate through the collection.
public Int32 IndexOf(String item) #Int32Determines the index of a specific item in the IList.
Parameters
- item System.String
- The object to locate in the IList.
Returns
The index of item if found in the list; otherwise, -1.
public Void Insert(Int32 index, String item) #VoidInserts an item to the IList at the specified index.
Parameters
- index System.Int32
- The zero-based index at which item should be inserted.
- item System.String
- The object to insert into the IList.
Exceptions
ArgumentOutOfRangeException– index is not a valid index in the IList.NotSupportedException– The IList is read-only.
public Boolean Remove(String item) #BooleanRemoves the first occurrence of a specific object from the ICollection.
Parameters
- item System.String
- The object to remove from the ICollection.
Returns
true if item was successfully removed from the ICollection; otherwise, false. This method also returns false if item is not found in the original ICollection.
Exceptions
NotSupportedException– The ICollection is read-only.
public Int32 RemoveAll(String category) #Int32Removes every category matching the supplied name case-insensitively.
Parameters
- category System.String
Returns
The number of removed category entries.
public Void RemoveAt(Int32 index) #VoidRemoves the IList item at the specified index.
Parameters
- index System.Int32
- The zero-based index of the item to remove.
Exceptions
ArgumentOutOfRangeException– index is not a valid index in the IList.NotSupportedException– The IList is read-only.
public Void ReplaceWith(IEnumerable<String> categories, Boolean removeDuplicates = true) #VoidReplaces the collection, optionally removing case-insensitive duplicates.
Parameters
- categories System.Collections.Generic.IEnumerable<System.String>
- removeDuplicates System.Boolean = true
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Int32 Count { get; } #Gets the number of elements contained in the ICollection.
public Boolean IsReadOnly { get; } #Gets a value indicating whether the ICollection is read-only.
public String this[Int32 index] { get; set; } #Gets or sets the element at the specified index.
Parameters
- index System.Int32
- The zero-based index of the element to get or set.
Exceptions
ArgumentOutOfRangeException– index is not a valid index in the IList.NotSupportedException– The property is set and the IList is read-only.