C# Class Localization.Xliff.OM.Serialization.XliffReader

This class reads XLIFF 2.0 documents.
Exibir arquivo Open project: Microsoft/XLIFF2-Object-Model Class Usage Examples

Public Methods

Method Description
Deserialize ( Stream stream ) : Localization.Xliff.OM.Core.XliffDocument

Deserializes XLIFF content from a stream.

DeserializeText ( XliffElement source, string text ) : void

Deserializes text into XLIFF elements under the specified source element.

RegisterExtensionHandler ( string ns, IExtensionHandler handler ) : void

Registers a handler to call when reading non-native XLIFF elements and attributes to store extension data.

UnregisterExtensionHandler ( string ns ) : void

Removes a handler to call when reading non-native XLIFF elements and attributes to store extension data.

XliffReader ( ) : System

Initializes a new instance of the XliffReader class using default settings.

XliffReader ( Localization.Xliff.OM.Serialization.XliffReaderSettings settings ) : System

Initializes a new instance of the XliffReader class.

Private Methods

Method Description
Deserialize ( XmlReader reader ) : Localization.Xliff.OM.Core.XliffDocument

Deserializes XLIFF content from an Xml stream.

DeserializeAttributes ( IXliffDataConsumer currentElement ) : void

Deserializes the attributes at the reader's current position and stores them in the currentElement.

DeserializeElement ( ) : void

Deserializes the element at the reader's current position as a new XliffElement.

DeserializeImpl ( ) : Localization.Xliff.OM.Core.XliffDocument

Implementation for de-serializing XLIFF content from an Xml stream.

DeserializeXmlContent ( XliffElement root ) : void

Deserializes the Xml content in the reader to the specified element.

StoreAttributeExtension ( IExtensible extensible ) : SetAttributeResult

Stores an attribute in an extension. If no appropriate extension handler was found, a general purpose one will be created.

ValidateElementState ( ElementState state ) : void

Validates the specified element state for correctness.

This method throws a FormatException if the state is malformed.

Method Details

Deserialize() public method

Deserializes XLIFF content from a stream.
public Deserialize ( Stream stream ) : Localization.Xliff.OM.Core.XliffDocument
stream Stream The stream to deserialize.
return Localization.Xliff.OM.Core.XliffDocument

DeserializeText() public static method

Deserializes text into XLIFF elements under the specified source element.
public static DeserializeText ( XliffElement source, string text ) : void
source XliffElement The element to deserialize content to.
text string The text to deserialize.
return void

RegisterExtensionHandler() public method

Registers a handler to call when reading non-native XLIFF elements and attributes to store extension data.
public RegisterExtensionHandler ( string ns, IExtensionHandler handler ) : void
ns string The namespace of items handled by the handler.
handler IExtensionHandler The handler to add.
return void

UnregisterExtensionHandler() public method

Removes a handler to call when reading non-native XLIFF elements and attributes to store extension data.
public UnregisterExtensionHandler ( string ns ) : void
ns string The namespace of the handler to remove.
return void

XliffReader() public method

Initializes a new instance of the XliffReader class using default settings.
public XliffReader ( ) : System
return System

XliffReader() public method

Initializes a new instance of the XliffReader class.
public XliffReader ( Localization.Xliff.OM.Serialization.XliffReaderSettings settings ) : System
settings Localization.Xliff.OM.Serialization.XliffReaderSettings Settings that determine how to read content.
return System