ArcGIS Explorer Component Help |
Symbol..::.CreateFromXmlString Method |
Symbol Class Example See Also |
Helper method to generate an object from its XML representation, used to deserialize an object passed to a worker thread.
Namespace:
ESRI.ArcGISExplorer.MappingAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public static Symbol CreateFromXmlString( string xml ) |
Visual Basic (Declaration) |
---|
Public Shared Function CreateFromXmlString ( _ xml As String _ ) As Symbol |
Parameters
- xml
- Type: System..::.String
The XML string from which the object is deserialized.
Return Value
A new object based on the XML representation.Remarks
The CreateFromXmlString and ToXmlString methods are provided as helper methods to make the code for serializing and deserializing ArcGIS Explorer objects simpler than comparable code using the .NET framework IXmlSerializable interface (although the IXmlSerializable interface is available if you wish to use it).
Serialization of ArcGIS Explorer objects xml is used in a number of situations; when saving a map, and also when passing objects between the UI thread and a background worker thread.
Examples
This method demonstrates the simplest way to serialize and deserialize an Explorer
object to an XML string, by using the ToXmlString and CreateFromXmlString methods.
CopyC#
// Create a new Point and serialize it to an XML representation. ESRI.ArcGISExplorer.Geometry.Point ptObject1 = new ESRI.ArcGISExplorer.Geometry.Point(); string ptXml = ptObject1.ToXmlString(); // Create a second Point by deserializing the XML string to a new object. ESRI.ArcGISExplorer.Geometry.Point ptObject2 = ESRI.ArcGISExplorer.Geometry.Point.CreateFromXmlString(ptXml);
CopyVB.NET
' Create a new Point and serialize it to an XML representation. Dim ptObject1 As ESRI.ArcGISExplorer.Geometry.Point = New ESRI.ArcGISExplorer.Geometry.Point() Dim ptXml As String = ptObject1.ToXmlString() ' Create a second Point by deserializing the XML string to a new object. Dim ptObject2 As ESRI.ArcGISExplorer.Geometry.Point = ESRI.ArcGISExplorer.Geometry.Point.CreateFromXmlString(ptXml)