User guide

DOKuStar Validation Programming Manual Page 94
All these commands correspond to certain events:
New => Application event OnProjectCreating, OnProjectCreated
Open => Application event OnProjectLoading, OnProjectLoaded
Close => Application event OnProjectClosed
Save => Project event OnSaving, OnSaved
ImportData => Data event OnPreImporting, OnPreImported, OnImported,
OnPostImported
ExportData => Data event OnPreExporting, OnPreExported, OnExported,
OnPostExported
It is assumed that the code that fills the
Data object is linked to the OnPreImporting/ed event. The
OnImported/OnPostImported events occur after data was loaded and could, for example, be used to set the
focus to a certain field.
Again, if an –
ing event is cancelled, the corresponding action does not take place.
The
ImportData command is dedicated to importing data, it is assumed that you put your code that fills the Data
object here.
However, this is not a must. If, for example, you want to fill it as soon as the Validation user opens a project file, you
could add the code in the
Application_OnProjectLoaded event.
The
OnPreExporting event is a good place to do checks across the whole data before exporting. See the “How
Do I…” chapter for an example.
Now for the code that generates a project file: Where is this code placed?
Again, this depends on your requirements. You could generate a project file „offline“: Write some code, that
instances a DOKuStar Validation
Application object without making it visible, fill the schema, and save it to a
project file. Or, it could be generated „inline“ whenever DOKuStar Validation is started, maybe in the
Application_OnFinalInitialized event.
You don’t even have to have project files! You could fill a schema on the fly when Validation starts.