Class FileBasedProject
This class provides an implementation of the IProject interface for working with Trados Studio projects.
Inheritance
Inherited Members
Namespace: Sdl.ProjectAutomation.FileBased
Assembly: Sdl.ProjectAutomation.FileBased.dll
Syntax
public class FileBasedProject : IProject, IProjectDeleteOperation
Remarks
An Trados Studio project always resides in a dedicated project folder on disk. Within this, you can find the following:
When creating a new FileBasedProject object, the project XML file is loaded into memory. Changes to the project are not saved automatically and only happen in memory. After doing a series of operations on a project, you need to call Save() to save the project XML file. You may choose to do this at key points to prevent losing data in case your application crashes.
The FileBasedProject class can be used to open any type of Trados Studio project. In order to create a project from a project package (*.sdlppx), use the static CreateFromProjectPackage(String, String, out ProjectPackageImport) method.
Project created using the Project Automation API will not automatically be added to the Trados Studio project list. In order to do this, simply open the project in Trados Studio, which will add it to the list.
Constructors
FileBasedProject(ProjectInfo)
Creates a new project based on the default project template set up in Trados Studio.
Declaration
public FileBasedProject(ProjectInfo projectInfo)
Parameters
Type | Name | Description |
---|---|---|
ProjectInfo | projectInfo | Properties to use when creating the project. |
Remarks
The default project template has to be set up before you can use this constructor. This is done automatically when Trados Studio starts for the first time after installation.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when trying to use this constructor before Trados Studio has initialized the default project template. |
System.ArgumentNullException | Thrown when |
System.ArgumentException | Thrown when |
FileBasedProject(ProjectInfo, ProjectReference)
Creates a new project based on an existing project.
Declaration
public FileBasedProject(ProjectInfo projectInfo, ProjectReference projectReference)
Parameters
Type | Name | Description |
---|---|---|
ProjectInfo | projectInfo | Properties to use when creating the project. |
ProjectReference | projectReference | The existing project to base this new project on. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.ArgumentException | Thrown when |
System.IO.FileNotFoundException | Thrown when |
ProjectAutomationException | Thrown when the reference project could not be loaded. |
FileBasedProject(ProjectInfo, ProjectTemplateReference)
Creates a new project based on a project template.
Declaration
public FileBasedProject(ProjectInfo projectInfo, ProjectTemplateReference templateReference)
Parameters
Type | Name | Description |
---|---|---|
ProjectInfo | projectInfo | Properties to use when creating the project. |
ProjectTemplateReference | templateReference | The project template to base this new project on. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.ArgumentException | Thrown when |
System.IO.FileNotFoundException | Thrown when |
ProjectAutomationException | Thrown when the template could not be loaded. |
FileBasedProject(String)
Opens an existing project.
Declaration
public FileBasedProject(string projectFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | projectFilePath | The absolute path to the project file (*.sdlproj). |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
System.IO.FileNotFoundException | Thrown when |
ProjectAutomationException | Thrown when the project at |
FileBasedProject(String, Boolean, String, String)
Opens an existing server project file.
Declaration
public FileBasedProject(string projectFilePath, bool useWindowsAuthentication, string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | projectFilePath | |
System.Boolean | useWindowsAuthentication | |
System.String | userName | |
System.String | password |
Properties
Credentials
Gets the ProjectCredentials which holds credentials for translation providers and termbase servers that will be used during project processing.
Declaration
public ProjectCredentials Credentials { get; }
Property Value
Type | Description |
---|---|
ProjectCredentials |
FilePath
The file path of the project file.
Declaration
public string FilePath { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
AddBilingualReferenceFile(BilingualFileMapping)
Associates a bilingual reference file (previously translated version) to a file in the project using a BilingualFileMapping
Declaration
public void AddBilingualReferenceFile(BilingualFileMapping mapping)
Parameters
Type | Name | Description |
---|---|---|
BilingualFileMapping | mapping |
AddBilingualReferenceFile(Guid, String)
Associates a bilingual reference file (previously translated version) to a file in the project.
Declaration
public void AddBilingualReferenceFile(Guid projectFileId, string fileToAdd)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | File Id of the file in the project to associate the bilingual file with. |
System.String | fileToAdd | Absolute path including file name of the bilingual file. |
AddBilingualReferenceFiles(BilingualFileMapping[])
Associates bilingual reference files (previously translated versions) to project files using an array of BilingualFileMapping objects
Declaration
public void AddBilingualReferenceFiles(BilingualFileMapping[] mappings)
Parameters
Type | Name | Description |
---|---|---|
BilingualFileMapping[] | mappings |
AddFiles(String[])
Adds a set of files into the project, in the root folder.
Declaration
public ProjectFile[] AddFiles(string[] filePaths)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | filePaths | The paths of the files to add. These should be absolute paths. |
Returns
Type | Description |
---|---|
ProjectFile[] | The added files |
AddFiles(String[], String)
Adds a set of files into the project, below a specified project folder.
Declaration
public ProjectFile[] AddFiles(string[] filePaths, string folderPathInProject)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | filePaths | The paths of the files to add. These should be absolute paths. |
System.String | folderPathInProject | The folder in this project below which the files should be added. If empty the files will be in the project root folder. |
Returns
Type | Description |
---|---|
ProjectFile[] | The added files |
AddFolderWithFiles(String, Boolean)
Adds all the files from a folder into the project, in the root folder
Declaration
public ProjectFile[] AddFolderWithFiles(string localFolderPath, bool recursive)
Parameters
Type | Name | Description |
---|---|---|
System.String | localFolderPath | The absolute path of the folder containing the files to add. |
System.Boolean | recursive | If |
Returns
Type | Description |
---|---|
ProjectFile[] | The added files |
AddFolderWithFiles(String, String, Boolean)
Adds all the files from a folder into the project, below a specified project folder.
Declaration
public ProjectFile[] AddFolderWithFiles(string localFolderPath, string folderPathInProject, bool recursive)
Parameters
Type | Name | Description |
---|---|---|
System.String | localFolderPath | The absolute path of the folder containing the files to add. |
System.String | folderPathInProject | The folder in this project below which the files should be added. If empty the files will be in the project root folder. |
System.Boolean | recursive | If |
Returns
Type | Description |
---|---|
ProjectFile[] | The added files |
AddMasterTM(TranslationProviderConfiguration, String)
Set master tm for target language
Declaration
public void AddMasterTM(TranslationProviderConfiguration translationProviderConfiguration, string targetIso)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderConfiguration | translationProviderConfiguration | |
System.String | targetIso |
AddNewFileVersion(Guid, String)
Adds the new file version.
Declaration
public void AddNewFileVersion(Guid projectFileId, string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | The file id. |
System.String | filePath | The local file path. |
CheckinFiles(Guid[], String, EventHandler<ProgressEventArgs>)
Uploads the specifies including potentially related files that should be uploaded at the same time and checks them in.
Declaration
public void CheckinFiles(Guid[] projectFileIds, string comment, EventHandler<ProgressEventArgs> progressEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to upload and check-in. |
System.String | comment | A comment for the checkin. |
System.EventHandler<ProgressEventArgs> | progressEventHandler | Progress event handler. |
Remarks
The method is to be used for check-out files only When passing in a locally added target language file, the corresponding source file is checked in and also all the related new target language files; but no other existing modified target language files. When passing in a locally added source file, the source file and all corresponding target languages files are uploaded and checked in.
CheckoutFiles(Guid[], Boolean, EventHandler<ProgressEventArgs>)
Checks out the files specified by project file id
Declaration
public void CheckoutFiles(Guid[] projectFileIds, bool overrideOnConflict, EventHandler<ProgressEventArgs> progressEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | |
System.Boolean | overrideOnConflict | |
System.EventHandler<ProgressEventArgs> | progressEventHandler |
Complete()
Change the project status to completed.
Declaration
public void Complete()
CreateFromProjectPackage(String, String, out ProjectPackageImport)
Creates a new project from a project package.
Declaration
public static FileBasedProject CreateFromProjectPackage(string projectPackageFilePath, string projectFolder, out ProjectPackageImport result)
Parameters
Type | Name | Description |
---|---|---|
System.String | projectPackageFilePath | The file path of the project package to open into a new project. Only native Trados Studio packages are supported (*.sdlppx). |
System.String | projectFolder | The file path of an empty folder to create the new project in. |
ProjectPackageImport | result | Information about the project package import operation. |
Returns
Type | Description |
---|---|
FileBasedProject | The newly created file-based project; or |
Remarks
Unlike Trados Studio, this API does not allow you to open a project package and merge it into a project that was previously created by opening a project package that originated from the same project. A new project is created for every project package you open using this method.
CreateFromProjectPackage(String, String, EventHandler<ProgressEventArgs>, EventHandler<MessageEventArgs>, out ProjectPackageImport)
Creates a new project from a project package.
Declaration
public static FileBasedProject CreateFromProjectPackage(string projectPackageFilePath, string projectFolder, EventHandler<ProgressEventArgs> statusEventHandler, EventHandler<MessageEventArgs> messageEventHandler, out ProjectPackageImport result)
Parameters
Type | Name | Description |
---|---|---|
System.String | projectPackageFilePath | The file path of the project package to open into a new project. |
System.String | projectFolder | The file path of an empty folder to create the new project in. |
System.EventHandler<ProgressEventArgs> | statusEventHandler | Event handler for package creation status events. Can be |
System.EventHandler<MessageEventArgs> | messageEventHandler | Event handler for message events. Can be |
ProjectPackageImport | result | Information about the project package import operation. |
Returns
Type | Description |
---|---|
FileBasedProject | The newly created file-based project; or |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.IO.FileNotFoundException | Thrown when |
System.ArgumentException | Thrown when |
CreateManualTask(String, String, DateTime, TaskFileInfo[])
Creates a manual task. A manual task includes a set of files that is assigned to a user. The created manual task can be used to create a project package using CreateProjectPackage(Guid, String, String, ProjectPackageCreationOptions, EventHandler<ProgressEventArgs>, EventHandler<MessageEventArgs>)
Declaration
public ManualTask CreateManualTask(string manualTaskName, string assignToUser, DateTime dueDate, TaskFileInfo[] inputFiles)
Parameters
Type | Name | Description |
---|---|---|
System.String | manualTaskName | The name of the manual task. Typically "Translate" or "Review", but other task names can be |
System.String | assignToUser | The user to assign the task to. |
System.DateTime | dueDate | The date by which the task should be completed. |
TaskFileInfo[] | inputFiles | The files to include in the task. |
Returns
Type | Description |
---|---|
ManualTask | The newly created manual task. |
CreateManualTask(String, String, DateTime, Guid[])
Creates a manual task. A manual task includes a set of files that is assigned to a user. The created manual task can be used to create a project package using CreateProjectPackage(Guid, String, String, ProjectPackageCreationOptions, EventHandler<ProgressEventArgs>, EventHandler<MessageEventArgs>)
Declaration
public ManualTask CreateManualTask(string manualTaskName, string assignToUser, DateTime dueDate, Guid[] projectFileIds)
Parameters
Type | Name | Description |
---|---|---|
System.String | manualTaskName | The name of the manual task. Typically "Translate" or "Review", but other task names can be |
System.String | assignToUser | The user to assign the task to. |
System.DateTime | dueDate | The date by which the task should be completed. |
System.Guid[] | projectFileIds | The project files to include in the task. Reference files will be marked as "read only" task files |
Returns
Type | Description |
---|---|
ManualTask |
Remarks
This overload allows a list of project file IDs to be specified rather than TaskFileInfo objects. A project file will be marked as a "read only" task file if it has a role of Sdl.ProjectApi.FileRole.Reference.
CreateMergedProjectFile(String, String, Guid[])
Creates a merged file from a number of translatable files in the project. This allows manipulating the content of all the child files within one physical file. For more information, see MergedProjectFile.
Declaration
public MergedProjectFile CreateMergedProjectFile(string mergedFileName, string folderPathInProject, Guid[] projectFileIds)
Parameters
Type | Name | Description |
---|---|---|
System.String | mergedFileName | The file name for the newly created merged file. This must have the ".sdlxliff" extension. |
System.String | folderPathInProject | The folder in this project in which the merged file be added. If empty the merged file will be in the project root folder. |
System.Guid[] | projectFileIds | The IDs of the translatable files to be merged in to one. |
Returns
Type | Description |
---|---|
MergedProjectFile | The newly created and added merged project file. |
CreateProjectPackage(Guid, String, String, ProjectPackageCreationOptions)
Creates a project package. The package can then be obtained using SavePackageAs(Guid, String).
Declaration
public ProjectPackageCreation CreateProjectPackage(Guid manualTaskId, string packageName, string comment, ProjectPackageCreationOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | manualTaskId | The ID of the task that the package relates to. (The task defines which files are included in the package.) |
System.String | packageName | The name of the package. |
System.String | comment | Optional comment. |
ProjectPackageCreationOptions | options | Various options to control what will be included in a project package. |
Returns
Type | Description |
---|---|
ProjectPackageCreation | A ProjectPackageCreation object, which contains the results of the package creation. |
CreateProjectPackage(Guid, String, String, ProjectPackageCreationOptions, EventHandler<ProgressEventArgs>, EventHandler<MessageEventArgs>)
Creates a project package. The package can then be obtained using SavePackageAs(Guid, String).
Declaration
public ProjectPackageCreation CreateProjectPackage(Guid manualTaskId, string packageName, string comment, ProjectPackageCreationOptions options, EventHandler<ProgressEventArgs> statusEventHandler, EventHandler<MessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | manualTaskId | The ID of the task that the package relates to. (The task defines which files are included in the package.) |
System.String | packageName | The name of the package. |
System.String | comment | Optional comment. |
ProjectPackageCreationOptions | options | Various options to control what will be included in a project package. |
System.EventHandler<ProgressEventArgs> | statusEventHandler | Event handler for package creation status events. |
System.EventHandler<MessageEventArgs> | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
ProjectPackageCreation | A ProjectPackageCreation object, which contains the results of the package creation. |
CreateReturnPackage(Guid[], String, String)
Creates a return package from a set of files. The files must all have previously been received as part of a project package in order for the return package to be created.
Declaration
public ReturnPackageCreation CreateReturnPackage(Guid[] projectFileIds, string packageName, string comment)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to include in the return package. |
System.String | packageName | The name of the package. |
System.String | comment | A comment for the package. |
Returns
Type | Description |
---|---|
ReturnPackageCreation | A ReturnPackageCreation object, representing the results of the return package creation. |
Remarks
It is only valid to call this method if this project was created from a project package
CreateReturnPackage(Guid[], String, String, EventHandler<ProgressEventArgs>, EventHandler<MessageEventArgs>)
Creates a return package from a set of files. The files must all have previously been received as part of a project package in order for the return package to be created.
Declaration
public ReturnPackageCreation CreateReturnPackage(Guid[] projectFileIds, string packageName, string comment, EventHandler<ProgressEventArgs> statusEventHandler, EventHandler<MessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to include in the return package. |
System.String | packageName | The name of the package. |
System.String | comment | A comment for the package. |
System.EventHandler<ProgressEventArgs> | statusEventHandler | Event handler for status events |
System.EventHandler<MessageEventArgs> | messageEventHandler | Event handler for message events |
Returns
Type | Description |
---|---|
ReturnPackageCreation | A ReturnPackageCreation object, representing the results of the return package creation. |
Remarks
It is only valid to call this method if this project was created from a project package
Delete()
Deletes the project. This deletes the entire project folder.
Declaration
public void Delete()
DeleteFilesAndDependencies(String)
Deletes the file and its dependencies
Declaration
public void DeleteFilesAndDependencies(string fileNameInProject)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileNameInProject |
DeleteFromServer()
Deletes the project from the server
Declaration
public void DeleteFromServer()
DownloadLatestServerVersion(Guid, EventHandler<DataTransferEventArgs>, Boolean)
Downloads the latest version of a file from the project server.
Declaration
public bool DownloadLatestServerVersion(Guid projectFileId, EventHandler<DataTransferEventArgs> progressEventHandler, bool force)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | The unique file id |
System.EventHandler<Sdl.ProjectApi.Server.DataTransferEventArgs> | progressEventHandler | A progress event handler, allowing the caller to cancel the download if required. |
System.Boolean | force | if set to |
Returns
Type | Description |
---|---|
System.Boolean | true if successful |
DownloadSpecificServerVersion(Guid, Int32, String, EventHandler<DataTransferEventArgs>)
Downloads a specific version of a file from the server in to the specified location
Declaration
public bool DownloadSpecificServerVersion(Guid projectFileId, int versionNumber, string localFilePath, EventHandler<DataTransferEventArgs> progressEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | The unique identifier for the file |
System.Int32 | versionNumber | The version number of the file you wish to download |
System.String | localFilePath | The location you wish to download the file to |
System.EventHandler<Sdl.ProjectApi.Server.DataTransferEventArgs> | progressEventHandler |
|
Returns
Type | Description |
---|---|
System.Boolean | true if successful |
GetAutomaticTask(Guid)
Retrieves an existing automatic task.
Declaration
public AutomaticTask GetAutomaticTask(Guid automaticTaskId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | automaticTaskId | The ID of the automatic task. |
Returns
Type | Description |
---|---|
AutomaticTask | The automatic task. |
GetFile(Guid)
Gets the file.
Declaration
public ProjectFile GetFile(Guid projectFileId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | The file id. |
Returns
Type | Description |
---|---|
ProjectFile | A ProjectFile object, representing the project file. |
GetFiles(Guid[])
Gets an array of files from an array of file ids.
Declaration
public ProjectFile[] GetFiles(Guid[] fileIds)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | fileIds | The array containing the fileIds. |
Returns
Type | Description |
---|---|
ProjectFile[] | An array of ProjectFile objects, representing the project files. |
GetFileTypeConfiguration()
Declaration
public ProjectFileTypeConfiguration GetFileTypeConfiguration()
Returns
Type | Description |
---|---|
ProjectFileTypeConfiguration |
GetManualTask(Guid)
Retrieves an existing manual task.
Declaration
public ManualTask GetManualTask(Guid manualTaskId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | manualTaskId | The ID of the manual task |
Returns
Type | Description |
---|---|
ManualTask | The newly created manual task. |
GetProjectFileVersionHistory(Guid)
Retrieves the history for a specific project file
Declaration
public ProjectFileVersion[] GetProjectFileVersionHistory(Guid projectFileId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId |
Returns
Type | Description |
---|---|
ProjectFileVersion[] |
GetProjectInfo()
Retrieves information about the project
Declaration
public ProjectInfo GetProjectInfo()
Returns
Type | Description |
---|---|
ProjectInfo | A ProjectInfo object that contains information about this project. |
GetProjectStatistics()
Gets the aggregated analysis, word count and confirmation statistics for all the files in the project. This will not actually compute the statistics, but just return a snapshot of the statistics that where most recently computed. To update the statistics, run the relevant task: WordCount, AnalyzeFiles or TranslationCount.
Declaration
public ProjectStatistics GetProjectStatistics()
Returns
Type | Description |
---|---|
ProjectStatistics | The aggregated analysis, word count and confirmation statistics for all the files in the project. |
GetSettings()
Gets the project-level settings.
Declaration
public ISettingsBundle GetSettings()
Returns
Type | Description |
---|---|
ISettingsBundle | A settings bundle containing the project settings. Never returns |
Remarks
Project settings can be overridden for a specific target language using UpdateSettings(Language, ISettingsBundle). The override mechanism works on an individual setting level, not on a settings bundle or group level. This means that any setting that is not specifically defined/overridden on the target language level will be inherited from the project-level settings.
GetSettings(Language)
Gets the settings for a specific target language.
Declaration
public ISettingsBundle GetSettings(Language targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The project target language for which to retrieve the settings. |
Returns
Type | Description |
---|---|
ISettingsBundle | A settings bundle containing the target language specific settings. The settings bundle returned will have a parent
settings bundle which represent the current project settings. Never returns |
Remarks
Target language settings override settings specified on the project level (see GetSettings(). The override mechanism works on an individual setting level, not on a settings bundle or group level. This means that any setting that is not specifically defined/overridden on the target language level will be inherited from the project-level settings.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
GetSourceLanguageFiles()
Retrieves all source language files.
Declaration
public ProjectFile[] GetSourceLanguageFiles()
Returns
Type | Description |
---|---|
ProjectFile[] | All the source language files in this project. |
GetTargetLanguageFiles()
Retrieves all target language files.
Declaration
public ProjectFile[] GetTargetLanguageFiles()
Returns
Type | Description |
---|---|
ProjectFile[] | An array of ProjectFile objects, representing all the target language files in this project. |
Remarks
For merged files (MergedProjectFile) with merge state NotMerged or Merged the merged file will be returned from this method, but not the child files. When the merge state is Split, only the child files are returned, not the merged file.
GetTargetLanguageFiles(Language)
Retrieves all files for the specified target language.
Declaration
public ProjectFile[] GetTargetLanguageFiles(Language targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The target language to retrieve files for. |
Returns
Type | Description |
---|---|
ProjectFile[] | An array of ProjectFile objects, representing all the files in this project with the specified target language. |
Remarks
For merged files (MergedProjectFile) with merge state NotMerged or Merged the merged file will be returned from this method, but not the child files. When the merge state is Split, only the child files are returned, not the merged file.
GetTermbaseConfiguration(Boolean)
Retrieves all termbase-related settings that are associated with this project.
Declaration
public TermbaseConfiguration GetTermbaseConfiguration(bool obtainCopy = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | obtainCopy |
Returns
Type | Description |
---|---|
TermbaseConfiguration | A TermbaseConfiguration object containing all termbase-related configuration for this project. |
GetTranslationProviderConfiguration()
Gets the translation provider configuration for this project.
Declaration
public TranslationProviderConfiguration GetTranslationProviderConfiguration()
Returns
Type | Description |
---|---|
TranslationProviderConfiguration | The translation provider configuration. This never returns |
Remarks
The translation provider configuration overridden for a specific target language (see GetTranslationProviderConfiguration(Language)) and UpdateTranslationProviderConfiguration(Language, TranslationProviderConfiguration)).
GetTranslationProviderConfiguration(Language)
Gets the translation provider configuration for the specified target language. If no specific configuration has been specified for the specified target language,
this method returns an empty (not null
!) configuration.
Declaration
public TranslationProviderConfiguration GetTranslationProviderConfiguration(Language targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The target language for which to get the translation provider configuration. |
Returns
Type | Description |
---|---|
TranslationProviderConfiguration | The translation provider configuration for the specified target language. This never returns |
ImportReturnPackage(String)
Imports a return package into this project.
Declaration
public ReturnPackageImport ImportReturnPackage(string returnPackageFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | returnPackageFilePath | The file path of the return package to import. Has file extension .sdlrpx |
Returns
Type | Description |
---|---|
ReturnPackageImport | Information about the import operation. |
ImportReturnPackage(String, EventHandler<ProgressEventArgs>, EventHandler<MessageEventArgs>)
Imports a return package into this project.
Declaration
public ReturnPackageImport ImportReturnPackage(string returnPackageFilePath, EventHandler<ProgressEventArgs> statusEventHandler, EventHandler<MessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.String | returnPackageFilePath | The file path of the return package to import. Has file extension .sdlrpx |
System.EventHandler<ProgressEventArgs> | statusEventHandler | Event handler for status events |
System.EventHandler<MessageEventArgs> | messageEventHandler | Event handler for message events |
Returns
Type | Description |
---|---|
ReturnPackageImport | Information about the import operation. |
OpenProjectFileStream(Guid)
Returns a stream that can be used to save out the latest version of the file.
Declaration
public Stream OpenProjectFileStream(Guid projectFileId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | The file to obtain the stream for. |
Returns
Type | Description |
---|---|
System.IO.Stream | A stream from which the file contents can be read. It is the responsibility of the caller to close this stream. |
PublishProject(Uri, Boolean, String, String, String, EventHandler<PublishProjectEventArgs>)
Publish this project to a Groupshare Project Server.
Declaration
public PublishProjectResult PublishProject(Uri serverUri, bool useWindowsAuthentication, string userName, string password, string organizationPath, EventHandler<PublishProjectEventArgs> progressEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | serverUri | The full URI of the project server e.g. https://projectserver.mydomain.com:8080 |
System.Boolean | useWindowsAuthentication | If true use window authentication, false use custom authentication |
System.String | userName | The user name you wish to use to publish the project |
System.String | password | The password you with to use to publish the project |
System.String | organizationPath | The organization path on the Groupshare server where you want the project to be published |
System.EventHandler<PublishProjectEventArgs> | progressEventHandler | Callback for monitoring the |
Returns
Type | Description |
---|---|
PublishProjectResult |
RemoveBilingualReferenceFile(Guid)
Removes a bilingual reference file (previously translated version) from a project file
Declaration
public void RemoveBilingualReferenceFile(Guid projectFileId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | File Id of the file in the project to remove the bilingual file from. |
RunAutomaticTask(Guid[], String)
Runs an automatic task on a set of files. Automatic task template IDs are defined in AutomaticTaskTemplateIds.
Declaration
public AutomaticTask RunAutomaticTask(Guid[] projectFileIds, string taskTemplateId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to run the task on. |
System.String | taskTemplateId | The ID of the task template (i.e. the type of task) to run. |
Returns
Type | Description |
---|---|
AutomaticTask | Information about the automatic task that has been run. |
Remarks
Multiple automatic tasks can be run together in a sequence using RunAutomaticTasks(Guid[], String[]).
RunAutomaticTask(Guid[], String, EventHandler<TaskStatusEventArgs>, EventHandler<TaskMessageEventArgs>)
Runs an automatic task on a set of files. Automatic task template IDs are defined in AutomaticTaskTemplateIds. This overload allows event handlers to be specified for task status and message events. These events support cancellation of the task.
Declaration
public AutomaticTask RunAutomaticTask(Guid[] projectFileIds, string taskTemplateId, EventHandler<TaskStatusEventArgs> statusEventHandler, EventHandler<TaskMessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to run the task on. |
System.String | taskTemplateId | The ID of the task template (i.e. the type of task) to run. |
System.EventHandler<TaskStatusEventArgs> | statusEventHandler | Event handler for task status events. |
System.EventHandler<TaskMessageEventArgs> | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
AutomaticTask | Information about the automatic task that has been run. |
Remarks
Multiple automatic tasks can be run together in a sequence using RunAutomaticTasks(Guid[], String[]).
RunAutomaticTasks(Guid[], String[])
Runs a sequence of automatic tasks on a set of project files. This can be more efficient than running tasks individually using RunAutomaticTask(Guid[], String), because content processing tasks can be executed in parallel. See the comments on AnalyzeFiles for more details.
Declaration
public TaskSequence RunAutomaticTasks(Guid[] projectFileIds, string[] taskTemplateIds)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to run the task on. |
System.String[] | taskTemplateIds | The IDs of the task templates (i.e. the types of task) to run. |
Returns
Type | Description |
---|---|
TaskSequence | Information about the sequence of tasks that has been run. |
RunAutomaticTasks(Guid[], String[], EventHandler<TaskStatusEventArgs>, EventHandler<TaskMessageEventArgs>)
Runs a sequence of automatic tasks on a set of project files. This can be more efficient than running tasks individually using RunAutomaticTask(Guid[], String), because content processing tasks can be executed in parallel. See the comments on AnalyzeFiles for more details.
Declaration
public TaskSequence RunAutomaticTasks(Guid[] projectFileIds, string[] taskTemplateIds, EventHandler<TaskStatusEventArgs> statusEventHandler, EventHandler<TaskMessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to run the task on. |
System.String[] | taskTemplateIds | The IDs of the task templates (i.e. the types of task) to run. |
System.EventHandler<TaskStatusEventArgs> | statusEventHandler | Event handler for task status events. |
System.EventHandler<TaskMessageEventArgs> | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
TaskSequence | Information about the sequence of tasks that has been run. |
RunDefaultTaskSequence(Guid[])
Runs the default task sequence of automatic tasks on a set of project files.
Declaration
public TaskSequence RunDefaultTaskSequence(Guid[] projectFileIds)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to run the task on. |
Returns
Type | Description |
---|---|
TaskSequence | Information about the sequence of tasks that has been run. |
RunDefaultTaskSequence(Guid[], EventHandler<TaskStatusEventArgs>, EventHandler<TaskMessageEventArgs>)
Runs the default task sequence of automatic tasks on a set of project files.
Declaration
public TaskSequence RunDefaultTaskSequence(Guid[] projectFileIds, EventHandler<TaskStatusEventArgs> statusEventHandler, EventHandler<TaskMessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The files to run the task on. |
System.EventHandler<TaskStatusEventArgs> | statusEventHandler | Event handler for task status events. |
System.EventHandler<TaskMessageEventArgs> | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
TaskSequence | Information about the sequence of tasks that has been run. |
Save()
Persists the project file. The file has extension .sdlproj and is located in the folder given by LocalProjectFolder. The project file path can be obtained using FilePath.
Declaration
public void Save()
Remarks
It is recommended to regularly save the project, for example after making a set of changes and after running a task.
SavePackageAs(Guid, String)
Saves out the package to a specified file location.
Declaration
public void SavePackageAs(Guid packageId, string path)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | packageId | The ID of the package to save. |
System.String | path | The file path to save the package to. |
SaveProjectFileAs(Guid, String)
Saves out the file to a specified file location.
Declaration
public void SaveProjectFileAs(Guid projectFileId, string outputFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | projectFileId | The file to save. |
System.String | outputFilePath | The file path to save the project file to. |
SaveTaskReportAs(Guid, String, ReportFormat)
Saves the task report out to a file, in the specified format
Declaration
public void SaveTaskReportAs(Guid reportId, string path, ReportFormat reportFormat)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | reportId | The id of the task report to save. |
System.String | path | The file path to save the report to. |
ReportFormat | reportFormat | The format used when saving out the report. |
SetFileRole(Guid[], FileRole)
Changes the role of the file. A Scan task (Scan) should be run after changing the file role in this way.
Declaration
public void SetFileRole(Guid[] projectFileIds, FileRole fileRole)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The IDs of the project files. |
FileRole | fileRole | The new FileRole value. |
SynchronizeServerProjectData()
Synchronizes the local project information with the information stored on the server
Declaration
public bool SynchronizeServerProjectData()
Returns
Type | Description |
---|---|
System.Boolean |
UndoCheckoutFiles(Guid[])
Removes the lock on server files without changing the version of the file on the server
Declaration
public void UndoCheckoutFiles(Guid[] projectFileIds)
Parameters
Type | Name | Description |
---|---|---|
System.Guid[] | projectFileIds | The list of files to uncheckout |
UpdateProject(ProjectInfo)
Updates the project with the new information contained in projectInfo
.
Declaration
public ProjectInfo UpdateProject(ProjectInfo projectInfo)
Parameters
Type | Name | Description |
---|---|---|
ProjectInfo | projectInfo | A object. |
Returns
Type | Description |
---|---|
ProjectInfo | The updated project information. |
Remarks
It is only valid to update certain properties. See the comments in ProjectInfo properties for more details. It is recommended to first obtain a ProjectInfo object using GetProjectInfo(), then modify its properties before passing into this update method.
UpdateSettings(Language, ISettingsBundle)
Updates the settings for a specific target language.
Declaration
public void UpdateSettings(Language targetLanguage, ISettingsBundle settings)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The target language for which to update the settings. |
ISettingsBundle | settings | A settings bundle representing the new target language settings. |
Remarks
Note that this method will only update the target-language settings. If you have changed the parent project-level settings too, thee need to be updated with a separate call to UpdateSettings(ISettingsBundle).
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown if |
UpdateSettings(ISettingsBundle)
Updates the project-level settings.
Declaration
public void UpdateSettings(ISettingsBundle settings)
Parameters
Type | Name | Description |
---|---|---|
ISettingsBundle | settings | A settings bundle object containing the new project settings. |
Remarks
The project settings will be completely replaced with the specified settings, so any settings not present in the updated settings bundle will revert to their defaults.
You can also override settings for a specific target language. See UpdateSettings(Language, ISettingsBundle).
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
UpdateTermbaseConfiguration(TermbaseConfiguration)
Updates the termbase-related settings for this project.
Declaration
public void UpdateTermbaseConfiguration(TermbaseConfiguration termbaseConfiguration)
Parameters
Type | Name | Description |
---|---|---|
TermbaseConfiguration | termbaseConfiguration | A TermbaseConfiguration object containing all termbase-related configuration for this project. This can either be newly created termbase configuration object or one that was retrieved via GetTermbaseConfiguration(Boolean). |
UpdateTranslationProviderConfiguration(Language, TranslationProviderConfiguration)
Updates the translation provider configuration for a specific project target language.
Declaration
public void UpdateTranslationProviderConfiguration(Language targetLanguage, TranslationProviderConfiguration translationProviderConfiguration)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The project target language for which to update the configuration. |
TranslationProviderConfiguration | translationProviderConfiguration | The translation provider configuration. Note that you need to set OverrideParent to in order for the configuration to be used. If this is
set to , the project-wide translation provider configuration will be used instead (GetTranslationProviderConfiguration()).
|
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown when |
System.ArgumentException | Thrown when |
UpdateTranslationProviderConfiguration(TranslationProviderConfiguration)
Updates the project-wide translation provider configuration.
Declaration
public void UpdateTranslationProviderConfiguration(TranslationProviderConfiguration translationProviderConfiguration)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderConfiguration | translationProviderConfiguration | The translation provider configuration. Note that the project-wide configuration might have been overridden for one or more specific project target languages (see UpdateTranslationProviderConfiguration(Language, TranslationProviderConfiguration)). The project-wide configuration will not be used for these target languages. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.ArgumentException | Thrown when |