PstPropertyValue Struct
Definition
Represents one property value of a property context or table-context row: the 16-bit property identifier, the raw wire type code, and the resolved little-endian payload with typed accessors over it.
public readonly struct PstPropertyValue
- Inherited Members
- Extension Methods
Remarks
This layer carries no MAPI semantics: the wire type is the raw MS-OXCDATA code and the payload is the value's little-endian bytes. Multi-valued and object-typed payloads are surfaced raw - decoding them is a format reader's concern.
Each typed accessor requires the matching wire type and a payload of at least the type's width;
GetString() decodes the UTF-16LE string type (0x001F) only - the code-page string type (0x001E)
stays bytes, because resolving its code page is a format-layer concern.
Properties
PropertyId
Gets the 16-bit property identifier.
public ushort PropertyId { get; }
Property Value
- ushort
The property identifier.
RawData
Gets the resolved value payload.
public ReadOnlyMemory<byte> RawData { get; }
Property Value
- ReadOnlyMemory<byte>
The value's little-endian bytes: inline values normalized to their natural width, heap- and subnode-resident values materialized in full. Empty for a null value.
WireType
Gets the raw 16-bit property wire type code.
public ushort WireType { get; }
Property Value
- ushort
The MS-OXCDATA type code, unchanged from the file.
Methods
GetBoolean()
Reads the value as a Boolean (wire type 0x000B): any nonzero byte is true.
public bool GetBoolean()
Returns
- bool
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetBytes()
Reads the value's payload as a byte array.
public byte[] GetBytes()
Returns
- byte[]
A copy of the resolved payload.
GetDouble()
Reads the value as a 64-bit floating-point number (wire type 0x0005, or the floating time 0x0007).
public double GetDouble()
Returns
- double
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetGuid()
Reads the value as a GUID (wire type 0x0048).
public Guid GetGuid()
Returns
- Guid
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetInt16()
Reads the value as a 16-bit signed integer (wire type 0x0002).
public short GetInt16()
Returns
- short
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetInt32()
Reads the value as a 32-bit signed integer (wire type 0x0003, or the 32-bit error code 0x000A).
public int GetInt32()
Returns
- int
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetInt64()
Reads the value as a 64-bit signed integer (wire types 0x0014, 0x0006, and the FILETIME
0x0040).
public long GetInt64()
Returns
- long
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetSingle()
Reads the value as a 32-bit floating-point number (wire type 0x0004).
public float GetSingle()
Returns
- float
The value.
Exceptions
- InvalidOperationException
The wire type or payload width does not match.
GetString()
Reads the value as a string (the UTF-16LE wire type 0x001F only).
public string GetString()
Returns
- string
The decoded string.
Exceptions
- InvalidOperationException
The wire type does not match.
ToString()
Returns a textual form of the value for diagnostics.
public override string ToString()
Returns
- string
The property identifier, wire type, and payload length.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |