First Parameter
The first parameter must be a delegate defined as
public delegate void StatusChangedEventHandler(object sender, TSBStatusChangedEventArgs e);
|
That references a method used to pass back to the application the current sort status. An example of how to create such a delegate where the method referenced is called sort_StatusChanged is as below
StatusChangedEventHandler statusChanged = new SoftwareBureau.SortMessages.StatusChangedEventHandler(sort_StatusChanged);
|
The method should be declared as follows
private void sort_StatusChanged(object sender, TSBStatusChangedEventArgs e)
{
}
|
The Sort API passes progress to this method within an object called TSBStatusChangedEventArgs. The properties of this object are
public bool Cancelled // If the application wishes to stop processing e.g. because the user requests process cancellation this property should be set to true
|
public int Phase // The current Phase of sort processing as an integer value
|
public string PhaseDescription // The current Phase of sort processing as a string value
|
public int Progress // The progress through the current phase in number of records processed
|
public int SortIndex // Should be ignored until further notice
|
These properties can be used to display progress information to the user.
|
Phase can be cast to SortProcessingStage. SortProcessingStage is defined in Appendix 2.
|
Second Parameter
The second parameter must be a delegate defined as
public delegate void AuditMessageReceivedHandler (object sender, TSBMessageEventArgs e);
|
That references a method used to pass back to the application ad hoc information. An example of how to create such a delegate where the method referenced is called sort_MessageReceived is as below
AuditMessageReceivedHandler messageReceived = new SoftwareBureau.SortMessages. AuditMessageReceivedHandler (sort_MessageReceived);
|
The method should be declared as follows
private void sort_MessageReceived (object sender, TSBMessageEventArgs e)
{
}
|
The Sort API passes ad hoc information via this method within TSBMessageEventArgs. This object has the following property.
public string Str // Contains an ad hoc message from the sort process e.g. “Verifying data format”
|
Third Parameter
string[] parameters = new string[] { “myProjectDefinition.xml” };
|
The third parameter is an array of string. As a bare minimum the first entry in the string array must be the name of a project definition xml file. Subsequent optional entries in the string array can either be override switches or the name of a text file that contains override switches. The override switch modify the parameter value contained in the project definition xml file.
string[] parameters = new string[] { “myProjectDefinition.xml”, “/Weight=66” }
|
string[] parameters = new string[] { “myProjectDefinition.xml”, “@X:\ParamFiles\myparams.txt” }
|
string[] parameters = new string[] { “myProjectDefinition.xml”, “@X:\ParamFiles\myparams.txt”, “/Weight=66” }
|