Table of Contents

Class RtzWriter

Namespace
EncDotNet.S100.Routes.Rtz
Assembly
EncDotNet.S100.Routes.Rtz.dll

Writes an RtzRoute as RTZ 1.0, 1.1 or 1.2.

public static class RtzWriter
Inheritance
RtzWriter
Inherited Members

Remarks

The writer follows the target version's schema: the root namespace and version, the schedule element's spelling (sheduleElement in 1.0), windows and stay as xsd:time (1.0) or xsd:duration, and a revision on every waypoint in 1.2 (0 when unset). An empty route name is written as "Route", since routeName is mandatory.

Extra attributes and extensions are written back. Extension elements in another RTZ version's namespace move to the target's. RTZ 1.1 and 1.2 hold extensions in extension elements with a manufacturer and name, so a bare extension element read from a 1.0 file is wrapped in one with manufacturer "unknown" and its own local name; a 1.0 file takes extension elements as they are. Only RTZ 1.2 lets a leg carry extensions, so they are left out of 1.0 and 1.1.

Methods

ToDocument(RtzRoute, string?)

The RTZ document of route.

public static XDocument ToDocument(RtzRoute route, string? version = null)

Parameters

route RtzRoute

The route.

version string

The RTZ version to write; the route's own when null.

Returns

XDocument

The document.

ToXml(RtzRoute, string?)

The RTZ text of route.

public static string ToXml(RtzRoute route, string? version = null)

Parameters

route RtzRoute

The route.

version string

The RTZ version to write; the route's own when null.

Returns

string

The XML.

Write(RtzRoute, Stream, string?)

Writes route to stream as UTF-8.

public static void Write(RtzRoute route, Stream stream, string? version = null)

Parameters

route RtzRoute

The route.

stream Stream

Where to write; left open.

version string

The RTZ version to write; the route's own when null.

Exceptions

ArgumentException

version isn't supported.

Write(RtzRoute, string, string?)

Writes route to the file at path.

public static void Write(RtzRoute route, string path, string? version = null)

Parameters

route RtzRoute

The route.

path string

The file to create or replace.

version string

The RTZ version to write; the route's own when null.