<p>XML codec for .NET object graphs. In order to resolve forward references when reading files the XML document that contains the data must be passed to the constructor.
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs an XML encoder/decoder with a new owner document. <ahref="#a07e453ed963ab7bc07639091b9e371cb"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs an XML encoder/decoder for the specified owner document. The document is required to resolve forward ID references. This means if you parse a graphmodel that is represented in XML you must also pass the document that contains the XML to the constructor, otherwise forward references will not be resolved. <ahref="#abc2542faf421e95e1074c8b4c8b88b21"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Assoiates the given object with the given ID. <ahref="#a662c18d5b7a3c7d31031653baec1c9fa"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the decoded object for the element with the specified ID in document. If the object is not known then lookup is used to find an object. If no object is found, then the element with the respective ID from the document is parsed using decode. <ahref="#af7284e48f4139e92b75c38598bec683e"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Hook for subclassers to implement a custom lookup mechanism for cell IDs. This implementation always returns null. <ahref="#abda3b8202fd04cb2e3730d3dd2560f9b"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the element with the given ID from the document. <ahref="#a1910f4beb57b5515cfd5a16119d78de0"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the element with the given ID from document. The optional attr argument specifies the name of the ID attribute. Default is id. The XPath expression used to find the element is //*[@id='arg'] where id is the name of the ID attribute (attributeName) and arg is the given id. <ahref="#ae5fbaf5134674b6fed89bbd36ad3259d"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns the ID of the specified object. This implementation calls reference first and if that returns null handles the object as an <aclass="el"href="classcom_1_1mxgraph_1_1mxCell.html"title="Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph.">mxCell</a> by returning their IDs using mxCell.getId. If no ID exists for the given cell, then an on-the-fly ID is generated using mxCellPath.create. <ahref="#ae259ea85ae98f767a6ebfb15468652ca"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null. <ahref="#a9e373d85a134b3b71d0969fa0faa0e4c"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Encodes the specified object and returns the resulting XML node. <ahref="#a3088b2e442dd7ea6f92a7ccba3b12251"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Decodes the given XML node using decode(XmlNode, Object). <ahref="#aa0ad136f46f6a2b29360bd1537ff30fc"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Decodes the given XML node. The optional "into" argument specifies an existing object to be used. If no object is given, then a new instance is created using the constructor from the codec. The function returns the passed in object or the new instance if no object was given. <ahref="#aa4d103574f3b6b379d7d7cca995a2a3d"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg. <aclass="el"href="classcom_1_1mxgraph_1_1mxModelCodec.html"title="Codec for mxGraphModels. This class is created and registered dynamically at load time and used impli...">mxModelCodec</a>, mxChildChangeCodec and mxRootChangeCodec). This implementation writes the given cell and its children as a (flat) sequence into the given node. The children are not encoded if the optional includeChildren is false. The function is in charge of adding the result into the given node and has no return value. <ahref="#a52442cecf5ce690681d95496c9673f87"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Decodes cells that have been encoded using inversion, ie. where the user object is the enclosing node in the XML, and restores the group and graph structure in the cells. Returns a new <aclass="el"href="classcom_1_1mxgraph_1_1mxCell.html"title="Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph.">mxCell</a> instance that represents the given node. <ahref="#a824d4ca6eaa4cf228e055c4485b7ea52"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Inserts the given cell into its parent and terminal cells. <ahref="#ae58f38afc74452857f2e339eba51f6b6"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the attribute on the specified node to value. This is a helper method that makes sure the attribute and value arguments are not null. <ahref="#a799403c766d5a6c12525fb0278c50e74"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Holds the owner document of the codec. <ahref="#aad8ec158a71d86cd392af0f7dc519b63"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">Dictionary< string, object > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcom_1_1mxgraph_1_1mxCodec.html#a04522d7a38095efb6263bd10518fc6cc">objects</a> = new Dictionary<string, Object>()</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Maps from IDs to objects. <ahref="#a04522d7a38095efb6263bd10518fc6cc"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Specifies if default values should be encoded. Default is false. <ahref="#a32a5c223e9e716534ee445271ca770ff"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets or returns the owner document of the codec. <ahref="#ad62be275d2f44acaf2e8be0a4a07ee4e"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets or returns if default values of member variables should be encoded. <ahref="#ab1f1547969b60eaf71b1aa5ac686ea2a"></a><br/></td></tr>
<divclass="textblock"><p>XML codec for .NET object graphs. In order to resolve forward references when reading files the XML document that contains the data must be passed to the constructor. </p>
</div><hr/><h2>Constructor & Destructor Documentation</h2>
<p>Constructs an XML encoder/decoder for the specified owner document. The document is required to resolve forward ID references. This means if you parse a graphmodel that is represented in XML you must also pass the document that contains the XML to the constructor, otherwise forward references will not be resolved. </p>
<tr><tdclass="paramname">document</td><td>Optional XML document that contains the data. If no document is specified then a new document is created using mxUtils.createDocument</td></tr>
<p>Decodes the given XML node. The optional "into" argument specifies an existing object to be used. If no object is given, then a new instance is created using the constructor from the codec. The function returns the passed in object or the new instance if no object was given. </p>
<dlclass="params"><dt><b>Parameters:</b></dt><dd>
<tableclass="params">
<tr><tdclass="paramname">node</td><td>XML node to be decoded.</td></tr>
<tr><tdclass="paramname">into</td><td>Optional object to be decodec into.</td></tr>
<p>Decodes cells that have been encoded using inversion, ie. where the user object is the enclosing node in the XML, and restores the group and graph structure in the cells. Returns a new <aclass="el"href="classcom_1_1mxgraph_1_1mxCell.html"title="Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph.">mxCell</a> instance that represents the given node. </p>
<dlclass="params"><dt><b>Parameters:</b></dt><dd>
<tableclass="params">
<tr><tdclass="paramname">node</td><td>XML node that contains the cell data.</td></tr>
<tr><tdclass="paramname">restoreStructures</td><td>Boolean indicating whether the graph structure should be restored by calling insert and insertEdge on the parent and terminals, respectively. </td></tr>
<p>Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg. <aclass="el"href="classcom_1_1mxgraph_1_1mxModelCodec.html"title="Codec for mxGraphModels. This class is created and registered dynamically at load time and used impli...">mxModelCodec</a>, mxChildChangeCodec and mxRootChangeCodec). This implementation writes the given cell and its children as a (flat) sequence into the given node. The children are not encoded if the optional includeChildren is false. The function is in charge of adding the result into the given node and has no return value. </p>
<dlclass="params"><dt><b>Parameters:</b></dt><dd>
<tableclass="params">
<tr><tdclass="paramname">cell</td><td><aclass="el"href="classcom_1_1mxgraph_1_1mxCell.html"title="Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph.">mxCell</a> to be encoded.</td></tr>
<tr><tdclass="paramname">node</td><td>Parent XML node to add the encoded cell into.</td></tr>
<tr><tdclass="paramname">includeChildren</td><td>Boolean indicating if the method should include all descendents</td></tr>
<p>Returns the element with the given ID from document. The optional attr argument specifies the name of the ID attribute. Default is id. The XPath expression used to find the element is //*[@id='arg'] where id is the name of the ID attribute (attributeName) and arg is the given id. </p>
<dlclass="params"><dt><b>Parameters:</b></dt><dd>
<tableclass="params">
<tr><tdclass="paramname">id</td><td>ID of the element to be returned.</td></tr>
<tr><tdclass="paramname">attributeName</td><td>Optional string for the attributename. Default is id.</td></tr>
<p>Returns the ID of the specified object. This implementation calls reference first and if that returns null handles the object as an <aclass="el"href="classcom_1_1mxgraph_1_1mxCell.html"title="Cells are the elements of the graph model. They represent the state of the groups, vertices and edges in a graph.">mxCell</a> by returning their IDs using mxCell.getId. If no ID exists for the given cell, then an on-the-fly ID is generated using mxCellPath.create. </p>
<dlclass="params"><dt><b>Parameters:</b></dt><dd>
<tableclass="params">
<tr><tdclass="paramname">obj</td><td>Object to return the ID for.</td></tr>
<p>Returns the decoded object for the element with the specified ID in document. If the object is not known then lookup is used to find an object. If no object is found, then the element with the respective ID from the document is parsed using decode. </p>