Click here to view all files
 
Helper method to serialize an object to its XML representation, used to serialize an object to pass to a worker thread.

Namespace:  ESRI.ArcGISExplorer.Geometry
Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.900 (2.0.0.900)

Syntax

C#
public string ToXmlString()
Visual Basic (Declaration)
Public Function ToXmlString As String

Return Value

An XML string based on the state of the object.

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)

See Also

Relate Topics:
  CreateFromXmlString Method
  Equals Method
  ExportToPrjString Method
  GetHashCode Method
  GetXmlSchema Method
  ImportFromPrjString Method
  ToString Method
Created by Atop CHM to web converter,© 2009 all right reserved.