MapiPropertyBag Class
The MAPI properties of an object to write: tagged properties, and named properties the writer maps to identifiers.
public sealed class MapiPropertyBagRemarks
The values are .NET values of the type documented by MapiPropertyType (String, Int32, DateTime, Byte arrays, arrays for the multi-valued types...). Strings are written as MapiPropertyType.String8 in an ANSI file.
Constructors
| Name | Description |
|---|---|
| MapiPropertyBag() |
MapiPropertyBag()
MapiPropertyBag.cspublic MapiPropertyBag()No documentation is available.
Properties
| Name | Description |
|---|---|
| Count | Gets the number of properties. |
| Names | Gets the names of the named properties. |
| Tags | Gets the tags of the tagged properties. |
Count
MapiPropertyBag.csNames
MapiPropertyBag.csGets the names of the named properties.
public IEnumerable<MapiNamedProperty> Names { get; }Property value
Gets the tags of the tagged properties.
public IEnumerable<MapiPropertyTag> Tags { get; }Property value
Methods
| Name | Description |
|---|---|
| Get(MapiNamedProperty) | Returns the value of a named property. |
| Get(ushort) | Returns the value of a tagged property. |
| Remove(MapiNamedProperty) | Removes a named property. |
| Remove(ushort) | Removes a tagged property. |
| Set(MapiNamedProperty, MapiPropertyType, object?) | Sets a named property. |
| Set(MapiPropertyTag, object?) | Sets a tagged property, replacing the property that has the same identifier. |
Get overloads
Get(MapiNamedProperty)
MapiPropertyBag.csReturns the value of a named property.
public object? Get(MapiNamedProperty name)Parameters
nameMapiNamedProperty- The name of the property.
Returns
object? The value, or null when the property is not set.
Get(ushort)
MapiPropertyBag.csRemove overloads
Remove(MapiNamedProperty)
MapiPropertyBag.csRemoves a named property.
public bool Remove(MapiNamedProperty name)Parameters
nameMapiNamedProperty- The name of the property.
Returns
bool true when the property was set.
Remove(ushort)
MapiPropertyBag.csSet overloads
Set(MapiNamedProperty, MapiPropertyType, object?)
MapiPropertyBag.csSets a named property.
public void Set(MapiNamedProperty name, MapiPropertyType type, object? value)Parameters
nameMapiNamedProperty- The name of the property.
typeMapiPropertyType- The type of the property.
valueobject?- The value, or
nullto remove the property.
Set(MapiPropertyTag, object?)
MapiPropertyBag.csSets a tagged property, replacing the property that has the same identifier.
public void Set(MapiPropertyTag tag, object? value)Parameters
tagMapiPropertyTag- The tag of the property. Its identifier must be below 0x8000.
valueobject?- The value, or
nullto remove the property.
Exceptions
ArgumentException- The identifier is in the range of the named properties.