'Declaration
Public Event WriteDataItem As DataItemEventHandler
'Usage
Dim instance As IdentificationProcessor Dim handler As DataItemEventHandler AddHandler instance.WriteDataItem, handler
public event DataItemEventHandler WriteDataItem
public: event DataItemEventHandler^ WriteDataItem
The event handler receives an argument of type DataItemEventArgs containing data related to this event. The following DataItemEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Content | The content of the data item to read or write. |
Type | The type of the data item to read or write. |
This object uses this event to write a data item to the persistent storage. This only happens when the object was unable to read the data item that it desired or because this object reconstructed the data item.
This object may be unable to read the data item for the follow reasons:
- This object had not previously created and written the data item.
- The ReadDataItem event handler did not load the data item.
- The ReadDataItem event does not have an event handler.
This object may reconstruct the data item for the following reasons:
- The IdentificationProcessor checksum changed.
- The data item is a different version than this toolkit.
- The data item is corrupted.
The event handler should save the data item content (as specified by Content) to persistent storage and also associate the type of the data item (as specified by Type) with the content in persistent storage.
Note: Users of FormFix are encouraged to implement handlers for this event and the ReadDataItem event in order to maximize FormFix's built-in optimizations. These events write and read metadata (data items) about the FormModels collection. This metadata is produced when an IdentificationProcessor analyzes the collection for the first time or when an IdentificationProcessor has to reconstruct the data items for one of the reasons described above. If these event handlers are correctly implemented, then the IdentificationProcessor may be able to skip the step of analyzing the FormModels collection.