Class AbstractFileLevelAutomaticTask
Base class for file level automatic task.
Inherited Members
Namespace: SdlSdl.ProjectAutomationAutomaticTasks
Assembly: Sdl.ProjectAutomation.AutomaticTasks.dll
Syntax
public abstract class AbstractFileLevelAutomaticTask
Constructors
AbstractFileLevelAutomaticTask()
Declaration
protected AbstractFileLevelAutomaticTask()
Properties
IsCancelRequested
Checks if the task is requested to be cancelled.
Declaration
public bool IsCancelRequested { get; }
Property Value
Type | Description |
---|---|
bool |
Project
Gets the project for this task.
Declaration
public IProject Project { get; }
Property Value
Type | Description |
---|---|
IProject |
ShouldAddNewFileVersion
Gets/Sets if this task should add a new version of the files. If the task updates the task files, it should be set to true so the updated files will be preserved.
Declaration
public bool ShouldAddNewFileVersion { get; set; }
Property Value
Type | Description |
---|---|
bool |
TaskFiles
Gets the files for this task.
Declaration
public ProjectFile[] TaskFiles { get; }
Property Value
Type | Description |
---|---|
ProjectFile |
Methods
Cancel(bool)
Called when the task execution is request to cancel.
Declaration
public virtual void Cancel(bool doRollback)
Parameters
Type | Name | Description |
---|---|---|
bool | doRollback |
Execute()
Executes the task. This function does the default implementation: ensure the files ready for the task, calls ProcessFile for each files and then populate the files if the files are updated.
Declaration
public virtual void Execute()
OnFileProgress(TaskProgressEventArgs)
Reports the progress of this task.
Declaration
protected virtual void OnFileProgress(TaskProgressEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TaskProgressEventArgs | e | The task progress event args |
OnInitializeTask()
Called when the task is initialized. Overwrite this function where further initialization is required.
Declaration
protected virtual void OnInitializeTask()
ProcessFile(ProjectFile)
Processes the file. It is implemented in the derived class.
Declaration
protected abstract void ProcessFile(ProjectFile projectFile)
Parameters
Type | Name | Description |
---|---|---|
ProjectFile | projectFile | the file to process |
TaskComplete()
Called when the task is completed. Overwrite this function when further operation is required.
Declaration
public virtual void TaskComplete()
UploadFile(ProjectFile, string)
Uploads the file for the new version generated.
Declaration
protected virtual void UploadFile(ProjectFile projectFile, string localFilePath)
Parameters
Type | Name | Description |
---|---|---|
ProjectFile | projectFile | The file to update |
string | localFilePath | The local path of the file. |
Events
Progress
The task progress event.
Declaration
public event EventHandler<TaskProgressEventArgs> Progress
Event Type
Type | Description |
---|---|
EventHandlerTaskProgressEventArgs |