Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MapiPropertyBag

OfficeIMO.Email

Namespace
OfficeIMO.Email
Assembly
OfficeIMO.Email
Source revision
c47203b3ce89 with working tree changes
Modifiers
sealed

Typed access to an ordered, duplicate-preserving MAPI property collection.

Inheritance

  • object
  • MapiPropertyBag

Remarks

Reads use the last property with a matching canonical identity. Raw properties remain untouched until MapiPropertyBag.Set or MapiPropertyBag.Remove is called.

Usage

Explore 6 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 5

Accepted by parameters 1

Constructors

public MapiPropertyBag(IList<MapiProperty> properties) #

Creates a typed view over an existing property collection.

Parameters

properties System.Collections.Generic.IList<OfficeIMO.Email.MapiProperty> required

Methods

public bool Contains(MapiPropertyKey key) #

Returns whether at least one raw property has the specified canonical identity.

Parameters

key OfficeIMO.Email.MapiPropertyKey required

Returns

bool
public MapiProperty? Find(MapiPropertyKey key) #

Finds the winning property with the key's canonical identity and an accepted wire type.

Parameters

key OfficeIMO.Email.MapiPropertyKey required

Returns

MapiProperty?
public IReadOnlyList<MapiProperty> FindAll(MapiPropertyKey key) #

Returns every property with the specified canonical identity and an accepted wire type.

Parameters

key OfficeIMO.Email.MapiPropertyKey required

Returns

IReadOnlyList<MapiProperty>
public IReadOnlyList<MapiProperty> FindAllRaw(MapiPropertyKey key) #

Returns every raw property with the specified canonical identity, in source order.

Parameters

key OfficeIMO.Email.MapiPropertyKey required

Returns

IReadOnlyList<MapiProperty>
public MapiProperty? FindRaw(MapiPropertyKey key) #

Finds the winning raw property by canonical identity without requiring an accepted wire type.

Parameters

key OfficeIMO.Email.MapiPropertyKey required

Returns

MapiProperty?
public T? GetNullableValue<T>(MapiPropertyKey<T> key) #

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

Type Parameters

T

Parameters

key OfficeIMO.Email.MapiPropertyKey<T> required

Returns

T?
public T? GetValueOrDefault<T>(MapiPropertyKey<T> key) #

Reads the winning typed value, or the managed default when it is absent or incompatible.

Type Parameters

T

Parameters

key OfficeIMO.Email.MapiPropertyKey<T> required

Returns

T?
public int Remove(MapiPropertyKey key) #

Removes all properties with the specified canonical identity.

Parameters

key OfficeIMO.Email.MapiPropertyKey required

Returns

int The number of removed raw properties.
public MapiProperty SetNull(MapiPropertyKey key, MapiPropertyType wireType, uint? flags = null) #

Writes a null placeholder for an object or null-typed MAPI property.

Parameters

key OfficeIMO.Email.MapiPropertyKey required
wireType OfficeIMO.Email.MapiPropertyType required
flags uint? = null optional
Set``1 2 overloads
public MapiProperty Set<T>(MapiPropertyKey<T?> key, T? value, uint? flags = null) #

Replaces every property with the same canonical identity and appends one property using the key's preferred wire type. Existing mapped property ID and flags are retained unless flags are supplied explicitly.

Type Parameters

T

Parameters

key OfficeIMO.Email.MapiPropertyKey<T?> required
value T? required
flags uint? = null optional
public MapiProperty Set<T>(MapiPropertyKey<T?> key, T? value, MapiPropertyType wireType, uint? flags = null) #

Writes a value using one of the key's accepted wire types.

Type Parameters

T

Parameters

key OfficeIMO.Email.MapiPropertyKey<T?> required
value T? required
wireType OfficeIMO.Email.MapiPropertyType required
flags uint? = null optional
public bool TryGetValue<T>(MapiPropertyKey<T> key, out T? value) #

Attempts to read the winning property using the key's wire and managed type contract.

Type Parameters

T

Parameters

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

Returns

bool

Properties

public IList<MapiProperty> Properties { get; } #

The exact mutable raw collection backing this bag.