MapiPropertyTag Struct
Definition
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
idushortThe 16-bit property identifier.
typeMapiPropertyTypeThe 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
valueuintThe 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
IsMultiValued
Gets a value indicating whether the tag denotes a multi-valued property.
public bool IsMultiValued { get; }
Property Value
IsNamed
Gets a value indicating whether the tag denotes a named property.
public bool IsNamed { get; }
Property Value
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
otherMapiPropertyTagThe tag to compare with.
Returns
Equals(object?)
Determines whether this tag equals another object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with.
Returns
- bool
true when
objis 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
idushortThe 16-bit property identifier.
elementTypeMapiPropertyTypeThe base type of each element.
Returns
- MapiPropertyTag
The tag whose type word carries
elementTypeand 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
0xfollowed by eight upper-case hexadecimal digits, for example0x0037001F.
Operators
operator ==(MapiPropertyTag, MapiPropertyTag)
Determines whether two tags carry the same raw value.
public static bool operator ==(MapiPropertyTag left, MapiPropertyTag right)
Parameters
leftMapiPropertyTagThe first tag.
rightMapiPropertyTagThe second tag.
Returns
operator !=(MapiPropertyTag, MapiPropertyTag)
Determines whether two tags carry different raw values.
public static bool operator !=(MapiPropertyTag left, MapiPropertyTag right)
Parameters
leftMapiPropertyTagThe first tag.
rightMapiPropertyTagThe second tag.
Returns
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |