Skip to content

GeoSerializer

Namespace: ThinkGeo.Core

This class serializes an object.

public class GeoSerializer

Inheritance ObjectGeoSerializer

Properties

Formatter

Gets or sets the Formatter. The Formatter determines what kind of serialized data will be created.

public GeoSerializationFormatter Formatter { get; set; }

Property Value

GeoSerializationFormatter

Constructors

GeoSerializer()

Creates an instance of GeoSerializer.

public GeoSerializer()

GeoSerializer(GeoSerializationFormatter)

public GeoSerializer(GeoSerializationFormatter formatter)

Parameters

formatter GeoSerializationFormatter

Methods

Serialize(Object, String)

Serialize an object and save the serialized data to a file.

public void Serialize(object objectToSerialize, string targetPathFilename)

Parameters

objectToSerialize Object
The object to be serialized.

targetPathFilename String
The path to save the serialized data to.

Serialize(Object, Stream)

Serialize an object and save the serialized data to a stream.

public void Serialize(object objectToSerialize, Stream targetStream)

Parameters

objectToSerialize Object
The object to be serialized.

targetStream Stream
The stream to save the serialized data into.

Serialize(Object)

Serialize an object and save the serialized data to a string.

public string Serialize(object objectToSerialize)

Parameters

objectToSerialize Object
The object to be serialized.

Returns

String
The string that contains the serialized data.

Deserialize(String, FileAccess)

Recreates an object from a file.

public object Deserialize(string sourcePathFilename, FileAccess readWriteMode)

Parameters

sourcePathFilename String
The file path to deserialize from.

readWriteMode FileAccess

Returns

Object
The recreated object.

Deserialize(Stream)

Recreates an object from a stream.

public object Deserialize(Stream sourceStream)

Parameters

sourceStream Stream
The Stream to deserialize from.

Returns

Object
The recreated object.

Deserialize(String)

Recreates an object from a string.

public object Deserialize(string sourceString)

Parameters

sourceString String
The string to deserialize from.

Returns

Object
The recreated object.

Deserialize(Uri)

Recreates an object from an Url.

public object Deserialize(Uri sourceUri)

Parameters

sourceUri Uri
The Url to deserialize from.

Returns

Object
The recreated object.