# MapiPropertyExtensions

Convenience lookup APIs for retained standard and named MAPI properties.

Class 

`OfficeIMO.Email`

**Namespace**

`OfficeIMO.Email`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[MapiPropertyExtensions.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L7)

**Modifiers**

static

Convenience lookup APIs for retained standard and named MAPI properties.

## Inheritance

- object
- MapiPropertyExtensions

Filter members 

Show inherited

## Methods

GetMapiProperty 4 overloads

`public static MapiProperty? GetMapiProperty(IEnumerable<MapiProperty> properties, MapiPropertyKey key)` [#](#method-getmapiproperty-collections-generic-ienumerable-officeimo-email-mapiproperty-officeimo-email-mapipropertykey)

[MapiPropertyExtensions.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L7)

Finds the last property matching a typed key's identity and accepted wire types.

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**key OfficeIMO.Email.MapiPropertyKey required**

Returns

`MapiProperty?`

`public static MapiProperty? GetMapiProperty(IEnumerable<MapiProperty> properties, ushort propertyId)` [#](#method-getmapiproperty-collections-generic-ienumerable-officeimo-email-mapiproperty-uint16)

[MapiPropertyExtensions.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L43)

Finds the last standard property with the specified property identifier.

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**propertyId ushort required**

Returns

`MapiProperty?`

`public static MapiProperty? GetMapiProperty(IEnumerable<MapiProperty> properties, Guid propertySet, uint localId)` [#](#method-getmapiproperty-collections-generic-ienumerable-officeimo-email-mapiproperty-guid-uint32)

[MapiPropertyExtensions.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L50)

Finds the last numeric named property with the specified canonical identity.

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**propertySet System.Guid required**

**localId uint required**

Returns

`MapiProperty?`

`public static MapiProperty? GetMapiProperty(IEnumerable<MapiProperty> properties, Guid propertySet, string name)` [#](#method-getmapiproperty-collections-generic-ienumerable-officeimo-email-mapiproperty-guid-string)

[MapiPropertyExtensions.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L58)

Finds the last string named property with the specified canonical identity.

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**propertySet System.Guid required**

**name string required**

Returns

`MapiProperty?`

`public static T? GetMapiValueOrDefault<T>(IEnumerable<MapiProperty> properties, MapiPropertyKey<T?> key)` [#](#method-getmapivalueordefault-collections-generic-ienumerable-officeimo-email-mapiproperty-officeimo-email-mapipropertykey)

[MapiPropertyExtensions.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L32)

Reads a typed property, or the managed default when it is absent or incompatible.

Type Parameters

**T**

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**key OfficeIMO.Email.MapiPropertyKey<T?> required**

Returns

`T?`

GetMapiValue``1 3 overloads

`public static T? GetMapiValue<T>(IEnumerable<MapiProperty> properties, ushort propertyId)` [#](#method-getmapivalue-collections-generic-ienumerable-officeimo-email-mapiproperty-uint16)

[MapiPropertyExtensions.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L66)

Gets a typed standard property value, or the default value when it is absent or has another type.

Type Parameters

**T**

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**propertyId ushort required**

Returns

`T?`

`public static T? GetMapiValue<T>(IEnumerable<MapiProperty> properties, Guid propertySet, uint localId)` [#](#method-getmapivalue-collections-generic-ienumerable-officeimo-email-mapiproperty-guid-uint32)

[MapiPropertyExtensions.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L72)

Gets a typed numeric named property value, or the default value when it is absent or has another type.

Type Parameters

**T**

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**propertySet System.Guid required**

**localId uint required**

Returns

`T?`

`public static T? GetMapiValue<T>(IEnumerable<MapiProperty> properties, Guid propertySet, string name)` [#](#method-getmapivalue-collections-generic-ienumerable-officeimo-email-mapiproperty-guid-string)

[MapiPropertyExtensions.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L78)

Gets a typed string named property value, or the default value when it is absent or has another type.

Type Parameters

**T**

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**propertySet System.Guid required**

**name string required**

Returns

`T?`

`public static T? GetNullableMapiValue<T>(IEnumerable<MapiProperty> properties, MapiPropertyKey<T> key)` [#](#method-getnullablemapivalue-collections-generic-ienumerable-officeimo-email-mapiproperty-officeimo-email-mapipropertykey)

[MapiPropertyExtensions.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L38)

Reads a value-type property, or null when it is absent or incompatible.

Type Parameters

**T**

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**key OfficeIMO.Email.MapiPropertyKey<T> required**

Returns

`T?`

`public static MapiProperty? GetRawMapiProperty(IEnumerable<MapiProperty> properties, MapiPropertyKey key)` [#](#method-getrawmapiproperty-collections-generic-ienumerable-officeimo-email-mapiproperty-officeimo-email-mapipropertykey)

[MapiPropertyExtensions.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L14)

Finds the last property matching a typed key's identity without checking its wire type.

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**key OfficeIMO.Email.MapiPropertyKey required**

Returns

`MapiProperty?`

`public static bool TryGetMapiValue<T>(IEnumerable<MapiProperty> properties, MapiPropertyKey<T?> key, out T? value)` [#](#method-trygetmapivalue-collections-generic-ienumerable-officeimo-email-mapiproperty-officeimo-email-mapipropertykey)

[MapiPropertyExtensions.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Mapi/MapiPropertyExtensions.cs#L22)

Attempts to read a property using a typed key.

Type Parameters

**T**

Parameters

**properties System.Collections.Generic.IEnumerable<OfficeIMO.Email.MapiProperty> required**

**key OfficeIMO.Email.MapiPropertyKey<T?> required**

**value T? required**

Returns

`bool`

## 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?`

<!-- PowerForge markdown artifact sha256:E293B20CB57DBDAEF7F617A46540542D951825AAA1FC7ECCD6DAAFA82171BCBA -->
