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>, IEnumerableProperties
| Name | Description |
|---|---|
| Count | Gets the number of properties. |
Methods
| Name | Description |
|---|---|
| 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.csReturns a named property.
public MapiProperty? Find(MapiNamedProperty name)Parameters
nameMapiNamedProperty- 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.csReturns the property that has a tag.
public MapiProperty? Find(MapiPropertyTag tag)Parameters
tagMapiPropertyTag- The tag of the property.
Returns
MapiProperty? The property, or null when the object does not have it.
Find(ushort)
MapiPropertyCollection.csReturns the property that has an identifier, whatever its type.
public MapiProperty? Find(ushort id)Parameters
idushort- The identifier of the property, such as 0x0037 for the subject.
Returns
MapiProperty? The property, or null when the object does not have it.
GetEnumerator()
MapiPropertyCollection.csReturns 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.csGets 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
nameMapiNamedProperty- 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.csGets 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
idushort- 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.csTryGetValue overloads
TryGetValue<T>(MapiNamedProperty, T)
MapiPropertyCollection.csGets the value of a named property, converted to T.
public bool TryGetValue<T>(MapiNamedProperty name, out T value)Type parameters
Parameters
nameMapiNamedProperty- The name of the property.
valueT- 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.csGets the value of a property, converted to T.