Table of Contents

MapiPropertyTag Struct

Definition

Namespace
Bodu.Formats.Outlook
Assembly
Bodu.Formats.Outlook.dll
Package
Bodu.Formats.Outlook 0.7.1
Source
MapiPropertyTag.cs

Represents a 32-bit MAPI property tag: a 16-bit property identifier in the high word and a 16-bit property type in the low word.

public readonly struct MapiPropertyTag : IEquatable<MapiPropertyTag>
Implements
Inherited Members
Extension Methods

Remarks

The tag layout follows MS-OXCDATA §2.11.4. The low word may carry the multi-valued flag (0x1000) in addition to a base MapiPropertyType code; Type always reports the base code and IsMultiValued reports the flag, while Value preserves the raw combination.

Identifiers at or above 0x8000 denote named properties whose meaning is defined by a MapiNamedProperty mapping rather than by the identifier itself.

Constructors

MapiPropertyTag(ushort, MapiPropertyType)

Initializes a new instance of the MapiPropertyTag struct from a property identifier and type.

public MapiPropertyTag(ushort id, MapiPropertyType type)

Parameters

id ushort

The 16-bit property identifier.

type MapiPropertyType

The property type. A value combining a base code with the multi-valued flag is preserved verbatim.

MapiPropertyTag(uint)

Initializes a new instance of the MapiPropertyTag struct from a raw 32-bit tag value.

public MapiPropertyTag(uint value)

Parameters

value uint

The raw tag: identifier in the high word, type (including any flags) in the low word.

Properties

Id

Gets the 16-bit property identifier.

public ushort Id { get; }

Property Value

ushort

The identifier from the high word of Value.

IsMultiValued

Gets a value indicating whether the tag denotes a multi-valued property.

public bool IsMultiValued { get; }

Property Value

bool

true when the type word carries the 0x1000 multi-valued flag.

IsNamed

Gets a value indicating whether the tag denotes a named property.

public bool IsNamed { get; }

Property Value

bool

true when Id is at or above 0x8000.

Type

Gets the base property type, with the multi-valued flag stripped.

public MapiPropertyType Type { get; }

Property Value

MapiPropertyType

The base MapiPropertyType code from the low word of Value.

Value

Gets the raw 32-bit tag value.

public uint Value { get; }

Property Value

uint

The identifier in the high word and the type word - including the multi-valued flag - in the low word.

Methods

Equals(MapiPropertyTag)

Determines whether this tag carries the same raw value as another.

public bool Equals(MapiPropertyTag other)

Parameters

other MapiPropertyTag

The tag to compare with.

Returns

bool

true when both tags have the same Value.

Equals(object?)

Determines whether this tag equals another object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with.

Returns

bool

true when obj is an equal MapiPropertyTag.

ForMultiValue(ushort, MapiPropertyType)

Creates the tag of a multi-valued property from its identifier and element type.

public static MapiPropertyTag ForMultiValue(ushort id, MapiPropertyType elementType)

Parameters

id ushort

The 16-bit property identifier.

elementType MapiPropertyType

The base type of each element.

Returns

MapiPropertyTag

The tag whose type word carries elementType and the multi-valued flag.

GetHashCode()

Returns a hash code consistent with Equals(MapiPropertyTag).

public override int GetHashCode()

Returns

int

A hash code computed over the raw tag value.

ToString()

Returns the canonical hexadecimal form of the tag.

public override string ToString()

Returns

string

The raw value as 0x followed by eight upper-case hexadecimal digits, for example 0x0037001F.

Operators

operator ==(MapiPropertyTag, MapiPropertyTag)

Determines whether two tags carry the same raw value.

public static bool operator ==(MapiPropertyTag left, MapiPropertyTag right)

Parameters

left MapiPropertyTag

The first tag.

right MapiPropertyTag

The second tag.

Returns

bool

true when the tags are equal.

operator !=(MapiPropertyTag, MapiPropertyTag)

Determines whether two tags carry different raw values.

public static bool operator !=(MapiPropertyTag left, MapiPropertyTag right)

Parameters

left MapiPropertyTag

The first tag.

right MapiPropertyTag

The second tag.

Returns

bool

true when the tags differ.

Applies to

ProductVersions
.NET8, 10