Click or drag to resize
MultiRecordEngine Class

This engine allows you to parse and write files that contain records of different types and that are in a linear relationship

(for Master-Detail check the MasterDetailEngine)

Inheritance Hierarchy
SystemObject
  FileHelpersEngineBase
    FileHelpersEventEngineBaseObject
      FileHelpersMultiRecordEngine

Namespace: FileHelpers
Assembly: FileHelpers (in FileHelpers.dll) Version: 3.1.5
Syntax
public sealed class MultiRecordEngine : EventEngineBase<Object>, 
	IEnumerable, IDisposable

The MultiRecordEngine type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyEncoding
The encoding to Read and Write the streams. Default is the system's current ANSI code page.
(Inherited from EngineBase.)
Public propertyErrorManager
This is a common class that manages the errors of the library.
(Inherited from EngineBase.)
Public propertyErrorMode
Indicates the behavior of the engine when it finds an error. {Shortcut for )
(Inherited from EngineBase.)
Public propertyFooterText
The Read Footer in the last Read operation. If any.
(Inherited from EngineBase.)
Public propertyHeaderText
The Read Header in the last Read operation. If any.
(Inherited from EngineBase.)
Public propertyCode exampleLastRecord
Public propertyLineNumber
The current line number.
(Inherited from EngineBase.)
Public propertyOptions
Allows you to change some record layout options at runtime
(Inherited from EngineBase.)
Public propertyRecordSelector
The Selector used by the engine in Read operations to determine the Type to use.
Public propertyRecordType
Returns the type of records handled by this engine.
(Inherited from EngineBase.)
Public propertyTotalRecords
The total numbers of records in the last read/written file (only works with whole read/write).
(Inherited from EngineBase.)
Top
Methods
  NameDescription
Public methodCode exampleAppendToFile(String, IEnumerable)
Append an array of records to the specified file.
Public methodCode exampleAppendToFile(String, Object)
Append a record to the specified file.
Public methodBeginAppendToFile
Open a file to be appended at the end.
Public methodBeginReadFile
Method used to use this engine in Async mode. Work together with ReadNext. (Remember to call Close after read the data)
Public methodBeginReadStream(TextReader)
Read a generic file as delimited by newlines
Public methodBeginReadStream(IRecordReader)
Method used to use this engine in Async mode. Work together with ReadNext. (Remember to call Close after read the data)
Public methodBeginReadString
Method used to use this engine in Async mode. Work together with ReadNext. (Remember to call Close after read the data)
Public methodBeginWriteFile
Open a file for write operations. If exist the engine override it. You can use WriteNext(Object) or WriteNexts(IEnumerable) to write records.
Public methodBeginWriteStream
Set the stream to be used in the WriteNext(Object) operation.
Public methodClose
Close the underlining Readers and Writers. (if any)
Public methodFlush
Save all the buffered data for write to the disk. Useful to long opened async engines that wants to save pending values or for engines used for logging.
Public methodGetFileHeader
Builds a line with the name of the fields, for a delimited files it uses the same delimiter, for a fixed length field it writes the fields names separated with tabs
(Inherited from EngineBase.)
Public methodReadFile
Read a File and returns the records.
Public methodReadNext
Reads the next record from the source
Public methodReadNexts
Read a defined number of records from the source
Public methodReadStream(TextReader)
Read an array of objects from a stream
Public methodCode exampleReadStream(IRecordReader)
Read a Stream and return an array of the contained records.
Public methodReadString
Read a String and return an array of the contained records.
Public methodCode exampleWriteFile(String, IEnumerable)
Write an array of records to the specified file.
Public methodCode exampleWriteFile(String, IEnumerable, Int32)
Write the specified number of records from the array to a file.
Public methodWriteNext
Write the next record to a file or stream opened with BeginWriteFile(String), BeginWriteStream(TextWriter) or BeginAppendToFile(String) method.
Public methodWriteNexts
Write the nexts records to a file or stream opened with BeginWriteFile(String), BeginWriteStream(TextWriter) or BeginAppendToFile(String) method.
Public methodWriteStream(TextWriter, IEnumerable)
Write the records to a file
Public methodCode exampleWriteStream(TextWriter, IEnumerable, Int32)
Write the specified number of records in the array to the Stream.
Public methodWriteString(IEnumerable)
Write an array of records to an String and return it.
Public methodWriteString(IEnumerable, Int32)
Write an array of records to an String and return it.
Top
Events
See Also