C# Class Habanero.BO.DataStoreInMemoryXmlReader

This class reads an xml stream and loads the objects in it into a DataStoreInMemory The class assumes you are loading afresh. Before doing the load, we recommend that you clear your BusinessObjectManager too so that you only have one instance of each object.
Exibir arquivo Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
Read ( Stream stream ) : DataStoreInMemory

Reads from a stream that contains xml text. Creates the XmlReader that reads the stream and then uses a default IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.

Read ( Stream stream, IBusinessObjectXmlReader boReader ) : DataStoreInMemory

Reads from a stream. Uses the given IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.

Read ( XmlReader xmlReader ) : DataStoreInMemory

Reads from an XmlReader. Uses a default IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.

Read ( XmlReader xmlReader, IBusinessObjectXmlReader boReader ) : DataStoreInMemory

Reads from a stream. Uses the given IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.

Read ( string xml ) : DataStoreInMemory

Reads from a string that contains xml text. Creates the XmlReader that reads the string and then uses a default IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.

Protected Methods

Method Description
ConfigureObjectAfterLoad ( IBusinessObject bo ) : IBusinessObject

Sets up the object after loading. In this case: 1. Sets the status of the object to not new, not dirty, not editing and not deleted. 2. Calls the BusinessObject.AfterLoad() method on the object 3. Backs up the property values, setting the persisted values of the properties

GetSettings ( ) : XmlReaderSettings

Returns the settings for the xml reader. Can be overridden to set your own settings.

Private Methods

Method Description
BuildExceptionMessage ( IEnumerable propertyReadExceptions ) : string

Method Details

ConfigureObjectAfterLoad() protected method

Sets up the object after loading. In this case: 1. Sets the status of the object to not new, not dirty, not editing and not deleted. 2. Calls the BusinessObject.AfterLoad() method on the object 3. Backs up the property values, setting the persisted values of the properties
protected ConfigureObjectAfterLoad ( IBusinessObject bo ) : IBusinessObject
bo IBusinessObject The object to configure
return IBusinessObject

GetSettings() protected method

Returns the settings for the xml reader. Can be overridden to set your own settings.
protected GetSettings ( ) : XmlReaderSettings
return System.Xml.XmlReaderSettings

Read() public method

Reads from a stream that contains xml text. Creates the XmlReader that reads the stream and then uses a default IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.
public Read ( Stream stream ) : DataStoreInMemory
stream Stream The stream to read from. This stream must contain xml text
return DataStoreInMemory

Read() public method

Reads from a stream. Uses the given IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.
public Read ( Stream stream, IBusinessObjectXmlReader boReader ) : DataStoreInMemory
stream Stream The stream to read the xml from
boReader IBusinessObjectXmlReader The to use. This object /// converts the xml data into business objects, so you can control how the objects are deserialised by /// creating your own.
return DataStoreInMemory

Read() public method

Reads from an XmlReader. Uses a default IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.
public Read ( XmlReader xmlReader ) : DataStoreInMemory
xmlReader XmlReader The reader to use
return DataStoreInMemory

Read() public method

Reads from a stream. Uses the given IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.
public Read ( XmlReader xmlReader, IBusinessObjectXmlReader boReader ) : DataStoreInMemory
xmlReader XmlReader The xml reader to use
boReader IBusinessObjectXmlReader The to use. This object /// converts the xml data into business objects, so you can control how the objects are deserialised by /// creating your own.
return DataStoreInMemory

Read() public method

Reads from a string that contains xml text. Creates the XmlReader that reads the string and then uses a default IBusinessObjectXmlReader to create the objects from the xml. Any errors that occur when setting properties on objects will be added to the ReadResult property. Once this method returns, check the Successful flag of the ReadResult to see if there are errors, and check the Message flag to see what the errors were.
public Read ( string xml ) : DataStoreInMemory
xml string The xml to read
return DataStoreInMemory