Struct XmpName
An XMP property name: a namespace URI and a local name, such as dc:title. Prefixes vary between files, so Egami never matches on them; XmpNamespaces holds the URIs of the common schemas.
public readonly record struct XmpName : IEquatable<XmpName>
- Implements
- Inherited Members
Examples
XmpData xmp = new()
{
Title = "Harbour at dawn",
Creators = ["A. Photographer"],
Keywords = ["harbour", "Bergen"],
Rating = 4,
};
// Any property, by namespace URI and local name; structures and arrays nest.
XmpStruct contact = new();
contact.Set(new XmpName(XmpNamespaces.IptcCore, "CiEmailWork"), "photo@example.com");
xmp.Set(new XmpName(XmpNamespaces.IptcCore, "CreatorContactInfo"), contact);
if (xmp.TryGet(new XmpName(XmpNamespaces.DublinCore, "title"), out object? title) && title is XmpArray languages)
{
languages.SetLanguage("nb-NO", "Havn ved daggry");
}
ReadOnlyMemory<byte> packet = xmp.ToBytes(); // canonical RDF/XML with padding
Constructors
XmpName(string, string)
An XMP property name: a namespace URI and a local name, such as dc:title. Prefixes vary between files, so Egami never matches on them; XmpNamespaces holds the URIs of the common schemas.
public XmpName(string Namespace, string Name)
Parameters
NamespacestringThe namespace URI, such as DublinCore.
NamestringThe local name, such as "title".
Examples
XmpData xmp = new()
{
Title = "Harbour at dawn",
Creators = ["A. Photographer"],
Keywords = ["harbour", "Bergen"],
Rating = 4,
};
// Any property, by namespace URI and local name; structures and arrays nest.
XmpStruct contact = new();
contact.Set(new XmpName(XmpNamespaces.IptcCore, "CiEmailWork"), "photo@example.com");
xmp.Set(new XmpName(XmpNamespaces.IptcCore, "CreatorContactInfo"), contact);
if (xmp.TryGet(new XmpName(XmpNamespaces.DublinCore, "title"), out object? title) && title is XmpArray languages)
{
languages.SetLanguage("nb-NO", "Havn ved daggry");
}
ReadOnlyMemory<byte> packet = xmp.ToBytes(); // canonical RDF/XML with padding
Properties
Name
The local name, such as "title".
public string Name { get; init; }
Property Value
Namespace
The namespace URI, such as DublinCore.
public string Namespace { get; init; }
Property Value
Methods
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.