FolderInfo.GetContents

GetContents(bool)

Gets information about the messages in the folder, optionally reading a damaged message list.

public MessageInfoCollection GetContents(bool tryToReadCorruptedContents)
ParameterTypeDescription
tryToReadCorruptedContentsBooleantrue to try to read the list of messages even if parts of it are damaged; use it when GetContents() fails because the file is corrupted. false gives the same result as GetContents().

Return Value

Information about the messages. Use PersonalStorage.ExtractMessage to load a full message.

See Also


GetContents()

Gets information about all messages in the folder.

public MessageInfoCollection GetContents()

Return Value

Information about the messages. Use PersonalStorage.ExtractMessage to load a full message.

Remarks

The whole list is read into memory. For a large folder, EnumerateMessages reads the messages one at a time.

See Also


GetContents(MessageKind)

Gets information about the messages of the specified kind.

public MessageInfoCollection GetContents(MessageKind kind)
ParameterTypeDescription
kindMessageKindNormal messages, folder associated information (FAI) items, or both.

Return Value

Information about the messages. Use PersonalStorage.ExtractMessage to load a full message.

See Also


GetContents(MailQuery)

Gets information about the messages that match a query.

public MessageInfoCollection GetContents(MailQuery query)
ParameterTypeDescription
queryMailQueryThe search query, built with PersonalStorageQueryBuilder.

Return Value

Information about the messages. Use PersonalStorage.ExtractMessage to load a full message.

See Also


GetContents(MailQuery, int, int)

Gets information about a range of the messages that match a query.

public MessageInfoCollection GetContents(MailQuery query, int startIndex, int count)
ParameterTypeDescription
queryMailQueryThe search query, built with PersonalStorageQueryBuilder.
startIndexInt32The zero-based index of the first message to return.
countInt32The maximum number of messages to return.

Return Value

Information about the messages. Use PersonalStorage.ExtractMessage to load a full message.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionstartIndex is less than 0.
ArgumentOutOfRangeExceptionstartIndex is greater than or equal to the number of messages in the folder, which includes any start index in an empty folder.

Remarks

If count is negative or greater than the number of remaining messages, all remaining messages are returned.

See Also


GetContents(int, int)

Gets information about a range of the messages in the folder.

public MessageInfoCollection GetContents(int startIndex, int count)
ParameterTypeDescription
startIndexInt32The zero-based index of the first message to return.
countInt32The maximum number of messages to return.

Return Value

Information about the messages. Use PersonalStorage.ExtractMessage to load a full message.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionstartIndex is less than 0.
ArgumentOutOfRangeExceptionstartIndex is greater than or equal to the number of messages in the folder, which includes any start index in an empty folder.

Remarks

If count is negative or greater than the number of remaining messages, all remaining messages are returned.

See Also