Class DdiReader
Reading any type of DDI xml file
Implements
Inherited Members
Namespace: Algenta.Colectica.Model.Ddi.Utility
Assembly: Algenta.Colectica.Model.Ddi.dll
Syntax
public class DdiReader : IDisposable
Properties
FileName
File path of DDI xml file
Declaration
public string FileName { get; }
Property Value
Type | Description |
---|---|
string |
Format
The format of the Ddi file
Declaration
public DdiFileFormat Format { get; }
Property Value
Type | Description |
---|---|
DdiFileFormat |
XmlDocument
The XML Document that was loaded by the Read method
Declaration
public XDocument XmlDocument { get; set; }
Property Value
Type | Description |
---|---|
XDocument |
Methods
Create(string)
Create a DDI file reader
Declaration
public static DdiReader Create(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The path to the DDI file |
Returns
Type | Description |
---|---|
DdiReader | A Ddi reader to use to read the file |
Dispose()
Dispose of all the resources
Declaration
public void Dispose()
Dispose(bool)
Protected implementation of Dispose pattern.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | disposing |
GetDdiFileFormat(string)
Determines the format of the DDI XML file.
Declaration
public static DdiFileFormat GetDdiFileFormat(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The full path and name of the DDI XML file. |
Returns
Type | Description |
---|---|
DdiFileFormat | The format of the DDI XML file. |
GetDdiFormat(StringReader)
Determines the format of the DDI XML content.
Declaration
public static DdiFileFormat GetDdiFormat(StringReader reader)
Parameters
Type | Name | Description |
---|---|---|
StringReader | reader | String reader |
Returns
Type | Description |
---|---|
DdiFileFormat | The DDI file format |
GetDdiFormat(string)
Determines the format of the DDI XML content.
Declaration
public static DdiFileFormat GetDdiFormat(string xmlContent)
Parameters
Type | Name | Description |
---|---|---|
string | xmlContent | DDI content as a string |
Returns
Type | Description |
---|---|
DdiFileFormat | The DDI file format |
GetDdiFormatFromStream(Stream)
Determines the format of the DDI XML content.
Declaration
public static DdiFileFormat GetDdiFormatFromStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | Stream of bytes in the correct encoding |
Returns
Type | Description |
---|---|
DdiFileFormat | The DDI file format |
Import(RepositoryClientBase, out Collection<TypedIdTriple>, out Collection<ResultMessage>)
Import the contents of a DDI file into the specified connection
Declaration
public bool Import(RepositoryClientBase client, out Collection<TypedIdTriple> topLevelItems, out Collection<ResultMessage> messages)
Parameters
Type | Name | Description |
---|---|---|
RepositoryClientBase | client | connection to store items into |
Collection<TypedIdTriple> | topLevelItems | Collection of top level references |
Collection<ResultMessage> | messages | Error and warning messages |
Returns
Type | Description |
---|---|
bool | true on success |
Read(out FragmentInstance, out Collection<ResultMessage>)
Read the contents of a DDI file
Declaration
public bool Read(out FragmentInstance fragmentInstance, out Collection<ResultMessage> messages)
Parameters
Type | Name | Description |
---|---|---|
FragmentInstance | fragmentInstance | A fragment instance containing the items |
Collection<ResultMessage> | messages | Any error or warning messages |
Returns
Type | Description |
---|---|
bool | A fragment containing the items in the file |
Events
ProgressChanged
Notifies listeners of progress on a single operation
Declaration
public event ProgressChangedEventHandler ProgressChanged
Event Type
Type | Description |
---|---|
ProgressChangedEventHandler |