# EmailStoreCategoryList

Lossless Outlook master category list. Known category elements can be edited while unknown XML is preserved.

Class 

`OfficeIMO.Email.Store`

**Namespace**

`OfficeIMO.Email.Store`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailStoreCategoryList.cs:97](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L97)

**Modifiers**

sealed

Lossless Outlook master category list. Known category elements can be edited while unknown XML is preserved.

## Inheritance

- object
- EmailStoreCategoryList

## Usage

Explore 3 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 3

- Property [EmailStoreAssociatedItem.CategoryList](/api/email/officeimo-email-store-emailstoreassociateditem/#property-categorylist)
- Method [EmailStoreCategoryList.Create](/api/email/officeimo-email-store-emailstorecategorylist/#method-create)
- Method [EmailStoreCategoryList.Parse](/api/email/officeimo-email-store-emailstorecategorylist/#method-parse-officeimo-email-emaildocument-int32)

Filter members 

Show inherited

## Methods

`public static EmailStoreCategoryList Create()` [#](#method-create)

[EmailStoreCategoryList.cs:97](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L97)

Creates an empty category list; add at least one category before serialization.

Returns

`EmailStoreCategoryList`

`public static EmailStoreCategoryList Parse(EmailDocument document, int maxXmlBytes = 4194304)` [#](#method-parse-officeimo-email-emaildocument-int32)

[EmailStoreCategoryList.cs:107](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L107)

Parses a category-list associated message using a strict XML byte bound.

Parameters

**document OfficeIMO.Email.EmailDocument required**

**maxXmlBytes int = 4194304 optional**

Returns

`EmailStoreCategoryList`

`public bool Remove(string name)` [#](#method-remove-string)

[EmailStoreCategoryList.cs:183](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L183)

Removes one category case-insensitively.

Parameters

**name string required**

Returns

`bool`

`public EmailStoreCategoryDefinition Set(string name, int color = -1, uint keyboardShortcut = 0, Guid? id = null, uint? usageCount = null, DateTimeOffset? lastUsed = null, bool renameOnFirstUse = false)` [#](#method-set-string-int32-uint32-nullable-system-guid-nullable-system-uint32-nullable-system-datetimeoffset-boolean)

[EmailStoreCategoryList.cs:155](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L155)

Adds or replaces one category while retaining unknown attributes on an existing element.

Parameters

**name string required**

**color int = -1 optional**

**keyboardShortcut uint = 0 optional**

**id System.Guid? = null optional**

**usageCount uint? = null optional**

**lastUsed System.DateTimeOffset? = null optional**

**renameOnFirstUse bool = false optional**

Returns

`EmailStoreCategoryDefinition`

`public EmailDocument ToAssociatedDocument(DateTimeOffset? savedAt = null)` [#](#method-toassociateddocument-nullable-system-datetimeoffset)

[EmailStoreCategoryList.cs:205](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L205)

Creates an Outlook-compatible FAI document for an associated Calendar-folder write.

Parameters

**savedAt System.DateTimeOffset? = null optional**

Returns

`EmailDocument`

`public byte[] ToXml(DateTimeOffset? savedAt = null)` [#](#method-toxml-nullable-system-datetimeoffset)

[EmailStoreCategoryList.cs:196](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L196)

Serializes the category XML, updating its last-saved time on the serialized snapshot.

Parameters

**savedAt System.DateTimeOffset? = null optional**

Returns

`byte[]`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<EmailStoreCategoryDefinition> Categories { get; }` [#](#property-categories)

[EmailStoreCategoryList.cs:120](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L120)

Every parsed category in XML order.

`public string DefaultCategoryName { get; set; }` [#](#property-defaultcategoryname)

[EmailStoreCategoryList.cs:125](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L125)

One-click default category name, or an empty string.

`public DateTimeOffset? LastSavedAt { get; }` [#](#property-lastsavedat)

[EmailStoreCategoryList.cs:138](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L138)

Last saved UTC time declared by the XML.

`public bool IsProtocolEnvelopeValid { get; }` [#](#property-isprotocolenvelopevalid)

[EmailStoreCategoryList.cs:143](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/AssociatedData/EmailStoreCategoryList.cs#L143)

True when the known protocol envelope and required category fields are valid.

<!-- PowerForge markdown artifact sha256:472B27AC1BD340FBE1E2BD816A21646B9AA965FC47AF625AEE05868389D6A481 -->
