Class CustomXmlDataStore
- Namespace
- DocWright.Dom.ContentControls
- Assembly
- DocWright.Dom.dll
Reads and writes the custom XML parts a content control can be bound to
(ECMA-376 Part 1 §17.5.2.6 w:dataBinding).
public sealed class CustomXmlDataStore
- Inheritance
-
CustomXmlDataStore
- Inherited Members
Remarks
The custom XML parts survive as opaque PreservedParts. This type parses the ones a binding actually names and leaves the rest untouched, which is what §3.3 asks for: the store item that nothing is bound to keeps its bytes exactly.
Both representations move together. A bound control's value lives in two places — the control's own content and the XML node — and Word treats the XML as authoritative, refreshing the control from it. Writing one without the other produces a document that looks right until Word next opens it. SetBoundValue(ContentControl, string) writes both; that is the point of the type.
Edits are splices, for the same reason islands are: re-serializing a whole custom XML part would rewrite bytes nothing asked to change.
Methods
- Flush()
Writes every modified custom XML part back onto its PreservedPart, so the next save carries the new data.
- GetStoreItemIds()
Gets the store item ids the document's custom XML parts declare, in part order.
- Open(WordDocument)
Opens the custom XML data of a document.
- ReadValue(ContentControlDataBinding)
Reads the value a binding points at.
- RefreshBoundControls(bool)
Refreshes every bound control in the document from the custom XML, which is the direction Word treats as authoritative.
- SetBoundValue(ContentControl, string)
Writes a value to a bound control, updating both the control's content and the custom XML node it is bound to.
- WriteValue(ContentControlDataBinding, string)
Writes a value through a binding, updating the custom XML part in memory.