[]
Specifies the information which shall be used to establish a mapping between a content control and an XML node stored within a Custom XML Data part in the document.
public class XmlMapping
Gets the identifier of the CustomXmlPart which shall be used to evaluate the given XPath property. If specified, then the XPath expression specified in the XPath property shall only be evaluated against the custom XML part whose properties part has a matching identifier. If no custom XML part exists with a matching identifier, then the XML mapping shall not be connected. If value is null or empty, then the XPath expression shall be evaluated against each custom XML data part in turn until the given XPath expression is resolved to an XML node.
public string CustomXmlPartId { get; }
Gets whether a mapping between a content control and an XML node stored within a Custom XML Data part in the document is established successfully.
public bool IsMapped { get; }
Gets the set of prefix mappings which shall be used to interpret the XPath expression specified on the XPath property when the XPath expression is evaluated against the custom XML data parts in the document. This property value shall be specified using the following syntax: xmlns:prefix='namespace', where prefix is the namespace prefix to be mapped, and namespace is the namespace to be mapped to the current prefix. Each prefix mapping shall be delimited by one or more whitespace characters.
public string PrefixMappings { get; }
Gets whether the xml mapping supports a content control with RichText type. if false (default), the rich text content controls are not supported, so no data stored in the XML node is mapped for this kind of controls. if true, the data stored in the XML node will be an escaped string comprised of a flattened document representing the formatted data in the content control range.
public bool SupportRichTextControl { get; }
Gets the XPath expression which shall be evaluated to find the custom XML node which is mapped to the content control. This XPath expression shall be specified using the syntax defined in the XML Path Language (XPath) Version 1.0 specification.
public string XPath { get; }
Removes mapping between a content control and an XML node stored within a Custom XML Data part in the document.
public void Clear()
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
obj
objectThe object to compare with the current object.
true if the specified object is equal to the current object; otherwise, false.
Serves as the default hash function.
public override int GetHashCode()
A hash code for the current object.
Set mapping between a content control and an XML node stored within a Custom XML Data part in the document.
public string SetMapping(string xPath, string prefixMappings = null, string customXmlPartId = null, bool supportRichTextControl = false)
xPath
stringThe XPath expression which shall be evaluated to find the custom XML node which is mapped to the content control.
prefixMappings
stringThe set of prefix mappings which shall be used to interpret the XPath expression when the XPath expression is evaluated against the custom XML data parts in the document.
customXmlPartId
stringThe CustomXmlPart identifier which shall be used to evaluate the given XPath expression.
supportRichTextControl
boolWhether the xml mapping supports a content control with RichText type.
Inner xml of the mapped node stored within a XmlDocument in the document.
Set mapping between a content control and an XML node stored within a Custom XML Data part in the document.
public string SetMapping(XmlNode node, string customXmlPartId = null, bool supportRichTextControl = false)
node
System.Xml.XmlNodeThe System.Xml.XmlNode which is mapped to the content control.
customXmlPartId
stringThe CustomXmlPart identifier which shall be used to evaluate the given XPath expression.
supportRichTextControl
boolWhether the xml mapping supports a content control with RichText type.
Inner xml of the mapped node stored within a XmlDocument in the document.
Set mapping between a content control and an XML node stored within a Custom XML Data part in the document.
public string SetMapping<T>(Expression<Func<T>> builtInDocumentProperty, bool supportRichTextControl = false)
builtInDocumentProperty
System.Linq.Expressions.Expression<TDelegate><Func<T>>The expression of a property from the BuiltInPropertyCollection which is mapped to the content control. Use it like this: SetMapping(() => document.Settings.BuiltInProperties.Author);
supportRichTextControl
boolWhether the xml mapping supports a content control with RichText type.
Inner xml of the mapped node stored within a XmlDocument in the document.
T
Tries get inner xml of the mapped node stored within a XmlDocument in the document.
public bool TryGetValue(out string value)
value
stringReturns inner xml of the mapped node stored within a XmlDocument in the document if mapping is established successfully, otherwise null.
true if mapping is established successfully, otherwise false.
Tries set inner xml to the mapped node stored within a XmlDocument in the document.
public bool TrySetValue(string value)
value
stringThe new inner xml for the mapped node stored within a XmlDocument in the document.
true if new inner xml was set successfully, otherwise false.