MapiPropertyCollection Class

The MAPI properties of an object: a folder, a message, a recipient or an attachment.

public sealed class MapiPropertyCollection : IEnumerable<MapiProperty>, IReadOnlyCollection<MapiProperty>, IEnumerable
Implements

Properties

NameDescription
CountGets the number of properties.

Gets the number of properties.

public int Count { get; }

Property value

int

Methods

NameDescription
Find(MapiNamedProperty)Returns a named property.
Find(MapiPropertyTag)Returns the property that has a tag.
Find(ushort)Returns the property that has an identifier, whatever its type.
GetEnumerator()Returns an enumerator that iterates through the collection.
GetValueOrDefault<T>(MapiNamedProperty)Gets the value of a named property, converted to T, or the default value of T.
GetValueOrDefault<T>(ushort)Gets the value of a property, converted to T, or the default value of T.
System.Collections.IEnumerable.GetEnumerator()
TryGetValue<T>(MapiNamedProperty, T)Gets the value of a named property, converted to T.
TryGetValue<T>(ushort, T)Gets the value of a property, converted to T.

Find overloads

Find(MapiNamedProperty)

MapiPropertyCollection.cs

Returns a named property.

public MapiProperty? Find(MapiNamedProperty name)
Parameters
name MapiNamedProperty
The name of the property.
Returns

MapiProperty? The property, or null when the object does not have it or the file does not map the name.

Find(MapiPropertyTag)

MapiPropertyCollection.cs

Returns the property that has a tag.

public MapiProperty? Find(MapiPropertyTag tag)
Parameters
tag MapiPropertyTag
The tag of the property.
Returns

MapiProperty? The property, or null when the object does not have it.

Returns the property that has an identifier, whatever its type.

public MapiProperty? Find(ushort id)
Parameters
id ushort
The identifier of the property, such as 0x0037 for the subject.
Returns

MapiProperty? The property, or null when the object does not have it.

Returns an enumerator that iterates through the collection.

public IEnumerator<MapiProperty> GetEnumerator()

Returns

IEnumerator<MapiProperty> An enumerator that can be used to iterate through the collection.

GetValueOrDefault overloads

GetValueOrDefault<T>(MapiNamedProperty)

MapiPropertyCollection.cs

Gets the value of a named property, converted to T, or the default value of T.

public T? GetValueOrDefault<T>(MapiNamedProperty name)
Type parameters
T
The type of the value.
Parameters
name MapiNamedProperty
The name of the property.
Returns

T? The value, or default when the object does not have the property or its value has another type.

GetValueOrDefault<T>(ushort)

MapiPropertyCollection.cs

Gets the value of a property, converted to T, or the default value of T.

public T? GetValueOrDefault<T>(ushort id)
Type parameters
T
The type of the value.
Parameters
id ushort
The identifier of the property.
Returns

T? The value, or default when the object does not have the property or its value has another type.

System.Collections.IEnumerable.GetEnumerator()

MapiPropertyCollection.cs
IEnumerator IEnumerable.GetEnumerator()

No documentation is available.

TryGetValue overloads

TryGetValue<T>(MapiNamedProperty, T)

MapiPropertyCollection.cs

Gets the value of a named property, converted to T.

public bool TryGetValue<T>(MapiNamedProperty name, out T value)
Type parameters
T
The type of the value, such as String, Int32 or DateTime.
Parameters
name MapiNamedProperty
The name of the property.
value T
The value, when the method returns true.
Returns

bool true when the object has the property and its value is a T.

TryGetValue<T>(ushort, T)

MapiPropertyCollection.cs

Gets the value of a property, converted to T.

public bool TryGetValue<T>(ushort id, out T value)
Type parameters
T
The type of the value, such as String, Int32 or DateTime.
Parameters
id ushort
The identifier of the property.
value T
The value, when the method returns true.
Returns

bool true when the object has the property and its value is a T.