Click or drag to resize

GenericXmlBridgeTDataAccess Class

A generic bridge that has read/write capabilities for accessing xml files using a DataContractSerializer.
Inheritance Hierarchy
SystemObject
  DHI.Mike1D.GenericGenericXmlBridgeTDataAccess
    More...

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
public class GenericXmlBridge<TDataAccess> : IBridge
where TDataAccess : AbstractDataAccess

Type Parameters

TDataAccess
A DataAccess component

The GenericXmlBridgeTDataAccess type exposes the following members.

Constructors
  NameDescription
Public methodGenericXmlBridgeTDataAccess
Initializes a new instance of the GenericXmlBridgeTDataAccess class
Top
Properties
  NameDescription
Public propertyData
DataAccess component being written to/from
Public propertyDataVersion
Version of data being read. Only applicable when reading data.
Public propertyFilePath
FilePath specifying the name of the persistance storage
Public propertyKnownTypes
List of known types used for reading/writing
Public propertySurrogate
Data contract surrogate to handle if certain types are to be serialized in special ways and when deserialized object needs to be connected in a way that the serializer can not do automatically. Per default this is set to a SerializerSurrogate object.
Public propertyXmlWriterSettings
Get/Set XmlWriterSettings in case xml output needs custom formatting This does not affect xml content, only formatting of the xml.
Top
Methods
  NameDescription
Protected methodCreateSerializer
Create serializer
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpen(IDiagnostics)
Opens the file in FilePath and Read data from xml file into the DataAccess component.

The xml must inlude data access versioning info. Input read using this method must be written using one of the Save methods.

The FilePath must have been set to a valid xml file.

Public methodOpen(Stream, IDiagnostics)
Open data stored in stream

The xml must inlude data access versioning info. Input read using this method must be written using one of the Save methods.

The FilePath must still have been set to a valid folder, to get relative paths in the setup right.

Public methodOpen(XmlReader, IDiagnostics)
Reads the DataAccess component from XmlReader.

The xml must inlude data access versioning info. Input read using this method must be written using one of the Save methods.

Public methodSave
Saves the DataAccess component to file, using its connection property.

The output inludes data access versioning info. Output stored using this method can be read again using the Open method.

Public methodSave(Stream)
Saves the DataAccess component to file, using its connection property.

The output inludes data access versioning info. Output stored using this method can be read again using the Open method.

Public methodSave(XmlWriter)
Writes the DataAccess component to XmlWriter.

The output inludes data access versioning info. Output stored using this method can be read again using the Open method.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Protected field_filePath
FilePath specifying the name of the persistance storage
Protected field_xmlWriterSettings
XmlWriterSettings in case xml output needs custom formatting This does not affect xml content, only formatting of the xml.
Top
See Also
Inheritance Hierarchy