Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OutlookCategoryCollection

Namespace OfficeIMO.Email
Assembly OfficeIMO.Email
Source revision 804a7612eee4 with working tree changes
Implements
IList<String> ICollection<String> IEnumerable<String> IEnumerable
Modifiers sealed
Attributes
DefaultMember("Item")

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

Constructors

public OutlookCategoryCollection() #

Methods

public Void Add(String item) #
Returns: Void

Adds an item to the ICollection.

Parameters

item System.String requiredposition: 0
The object to add to the ICollection.

Exceptions

  • NotSupportedException – The ICollection is read-only.
public Boolean AddIfMissing(String category) #
Returns: Boolean

Adds a non-empty category unless an equivalent name already exists.

Parameters

category System.String requiredposition: 0

Returns

true when the category was added.

public Void Clear() #
Returns: Void

Removes all items from the ICollection.

Exceptions

  • NotSupportedException – The ICollection is read-only.
Contains 2 overloads
public Boolean Contains(String category, StringComparer comparer) #
Returns: Boolean

Returns whether the collection contains a category using the requested comparison.

Parameters

category System.String requiredposition: 0
comparer System.StringComparer requiredposition: 1
public Boolean Contains(String item) #
Returns: Boolean

Determines whether the ICollection contains a specific value.

Parameters

item System.String requiredposition: 0
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) #
Returns: Void

Copies the elements of the ICollection to an Array, starting at a particular Array index.

Parameters

array System.String[] requiredposition: 0
The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing.
arrayIndex System.Int32 requiredposition: 1
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() #
Returns: 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) #
Returns: Int32

Determines the index of a specific item in the IList.

Parameters

item System.String requiredposition: 0
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) #
Returns: Void

Inserts an item to the IList at the specified index.

Parameters

index System.Int32 requiredposition: 0
The zero-based index at which item should be inserted.
item System.String requiredposition: 1
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) #
Returns: Boolean

Removes the first occurrence of a specific object from the ICollection.

Parameters

item System.String requiredposition: 0
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) #
Returns: Int32

Removes every category matching the supplied name case-insensitively.

Parameters

category System.String requiredposition: 0

Returns

The number of removed category entries.

public Void RemoveAt(Int32 index) #
Returns: Void

Removes the IList item at the specified index.

Parameters

index System.Int32 requiredposition: 0
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) #
Returns: Void

Replaces the collection, optionally removing case-insensitive duplicates.

Parameters

categories System.Collections.Generic.IEnumerable<System.String> requiredposition: 0
removeDuplicates System.Boolean = true optionalposition: 1

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 requiredposition: 0
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.