Table of Contents

OutlookMailFolder Class

Definition

Namespace
Bodu.Formats.Outlook
Assembly
Bodu.Formats.Outlook.Pst.dll
Package
Bodu.Formats.Outlook.Pst 0.7.1
Source
OutlookMailFolder.cs

Represents one folder of a mail store: its decoded properties and streaming access to its subfolders and messages.

public sealed class OutlookMailFolder
Inheritance
OutlookMailFolder
Inherited Members
Extension Methods

Remarks

Folder views are bound to their owning OutlookMailStore session. Enumerations stream the folder's hierarchy and contents tables one row block at a time - nothing is materialized ahead of iteration - and a folder whose table node is absent enumerates empty, matching real-world stores that omit empty tables.

Under strict validation a table row that does not reference a valid node of the expected kind throws OutlookPstFormatException; under the tolerant levels the row is skipped.

Properties

ContainerClass

Gets the folder container class (for example, IPF.Note).

public string? ContainerClass { get; }

Property Value

string

The PidTagContainerClass value, or null when absent.

DisplayName

Gets the folder display name.

public string? DisplayName { get; }

Property Value

string

The PidTagDisplayName value, or null when absent.

HasSubfolders

Gets a value indicating whether the folder declares subfolders.

public bool HasSubfolders { get; }

Property Value

bool

The PidTagSubfolders value; false when absent.

MessageCount

Gets the number of messages the folder declares.

public int? MessageCount { get; }

Property Value

int?

The PidTagContentCount value, or null when absent.

Properties

Gets every decoded property of the folder.

public MapiPropertyCollection Properties { get; }

Property Value

MapiPropertyCollection

The tag-addressed property collection, decoded once on first access.

Exceptions

ObjectDisposedException

The owning session has been disposed.

PstFileException

The container is malformed.

UnreadCount

Gets the number of unread messages the folder declares.

public int? UnreadCount { get; }

Property Value

int?

The PidTagContentUnreadCount value, or null when absent.

Methods

EnumerateAssociatedMessages()

Enumerates the folder's associated (folder-associated-information) messages, in table order.

public IEnumerable<OutlookMailMessage> EnumerateAssociatedMessages()

Returns

IEnumerable<OutlookMailMessage>

The associated-message views; empty when the folder has no associated-contents table.

Exceptions

ObjectDisposedException

The owning session has been disposed.

PstFileException

The container is malformed.

OutlookPstFormatException

Under strict validation, an associated-contents row does not reference a valid message node.

EnumerateMessages()

Enumerates the folder's messages, in contents-table order.

public IEnumerable<OutlookMailMessage> EnumerateMessages()

Returns

IEnumerable<OutlookMailMessage>

The message views; empty when the folder has no contents table.

Exceptions

ObjectDisposedException

The owning session has been disposed.

PstFileException

The container is malformed.

OutlookPstFormatException

Under strict validation, a contents row does not reference a valid message node.

EnumerateSubfolders()

Enumerates the folder's immediate subfolders, in hierarchy-table order.

public IEnumerable<OutlookMailFolder> EnumerateSubfolders()

Returns

IEnumerable<OutlookMailFolder>

The subfolder views; empty when the folder has no hierarchy table.

Remarks

Search folders are Outlook runtime state, not archive content, and are excluded from the enumeration at every validation level - the standard search root hangs off the hierarchy of real stores.

Exceptions

ObjectDisposedException

The owning session has been disposed.

PstFileException

The container is malformed.

OutlookPstFormatException

Under strict validation, a hierarchy row does not reference a valid folder node.

ToString()

Returns a textual form of the folder for diagnostics.

public override string ToString()

Returns

string

The display name, or the node identifier when unnamed.

Applies to

ProductVersions
.NET8, 10