Before choosing Batch Task as template to build your plugin you should ask yourself if this template is suitable for your needs. Take your time and respond to this questions:
When you create a project using Batch Task template the following files will be generated:
- Depending on the name of your solution you'll have a class which has the following annotation [AutomaticTask].This class is the entry point of your plugin. By default it has two methods:
- ConfigureConverter() method will be called when user clicks on "Finish" button. From here the logic of your application will begin.
- OnInitializeTask() ,is the method from where you can get your Batch Task settings saved on the project.
To get the setting use following method GetSetting<CustomSettings>(). Where CustomSettings is a class which inherits from SettingsGroup class.
- If your plugin should process sdlxliff files OnFileComplete() method should be added!. Just paste the following code on your class. This allows your application to override the xliff. If you don't add this your changes on the file will not be saved.
public override bool OnFileComplete(ProjectFile projectFile, IMultiFileConverter multiFileConverter)
{
return true;
}
2. An User Control where the UI of the application should be added.
3. An class which inherits SettingsGroup. This class is used to set end get custom settings for your plugin.
4. An SettingsPage which inherits DefaultSettingsPage. Here you add the logic if you want to set some information triggered on the following events: Save, Cancel, ValidateInput and so on.
In the following pages we'll explain how the settings from User Control should be saved in SettingsGroup class and how you can update the user interface based on the information you already have saved in settings.
Please go to How bind a DataGridView to SettingsGroup page to continue the tutorial.