Amazon Wish List News RSS feed. Development Blog Browse the Forums  
  Overview - Downloads - Examples - News Feed - Contact Info -

Events Architecture

Some time you need to ignore certain lines in files or you need to change a value after the record is filled, etc.

To solve these problems I´ve add a event architecture in the FileHelperEngine (in the future in all the others)

The events are 4 (2 for read and 2 for write ops):

  • BeforeReadRecord
  • AfterReadRecord
  • BeforeWriteRecord
  • AfterWriteRecord

The names said all right ?

The Example

Supose that you need to parse a txt report from a legacy system with these format

You must declare a Record Mapping Class for the main record:

So now is the time where we instanciate the engine and hook to the events.

So in the event method we ignore the lines with spaces and -

Note: if you change the RecordLine the engine use the changed value
This can be useful in some cases but you must be carefull

See also

Must Read - Quick Start Guide - Attributes List - F.A.Q. - Examples of Use - Contacts & Credits - Donations

© 2005-07 to Marcos Meli

FileHelpers on SourceForge
Browse the Forums Development Blog
Support the project
Devoo Software
Powered by:

Source Forge Thanks Jetbrains for support us !! Thanks BB Software for support us !! TestDriven.NET Code Coverage by Clover.NET Code Project Article Larkware News Sharp Toolbox