Class ProjectFile
Represents a file in a project.
Inherited Members
Namespace: Sdl.ProjectAutomation.Core
Assembly: Sdl.ProjectAutomation.Core.dll
Syntax
public class ProjectFile
Properties
AnalysisStatistics
Gets the analysis statistics for this file. Returns null if this is not a translatable file.
For source-language files, returns the word count statistics only. For target-language files, returns the full
translation provider analysis statistics. Note that you need to run the AnalyzeFiles
or WordCount tasks to generate these statistics.
Declaration
public AnalysisStatistics AnalysisStatistics { get; }
Property Value
| Type | Description |
|---|---|
| AnalysisStatistics |
BilingualReferenceFileLocalPath
Gets the path of the bilingual reference file associated with this file (Previously translated version of the file). Thi is required for Perfect Match operations.
Declaration
public string BilingualReferenceFileLocalPath { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
CheckedOutAt
The date the file was checked or null if not checked out when shared on a project server
Declaration
public DateTime? CheckedOutAt { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.DateTime> |
CheckedOutTo
The user that the file is checked out to if shared on a project server
Declaration
public string CheckedOutTo { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ConfirmationStatistics
Gets the confirmation statistics for this file. Returns null if this is not a translatable file.
Note that you need to run the TranslationCount task to
generate these statistics.
Declaration
public ConfirmationStatistics ConfirmationStatistics { get; }
Property Value
| Type | Description |
|---|---|
| ConfirmationStatistics |
CurrentServerVersion
The version of this file stored in the local file system
Declaration
public int CurrentServerVersion { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
FileTypeId
Gets the File Type Identifier of the file type that will be used to process this file. This is only relevant for translatable files (where Role equals Translatable) and is set by the Scan task (see Scan.
Declaration
public string FileTypeId { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Folder
Gets the logical project folder in which this file resides.
Declaration
public string Folder { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Id
Gets the unique ID of the file.
Declaration
public Guid Id { get; }
Property Value
| Type | Description |
|---|---|
| System.Guid |
IsCheckedOut
Set to true when the file has been checked out for editing by any user when shared on a project server
Declaration
public bool IsCheckedOut { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsCheckedOutToAnotherUser
Set to true when the file has been checked out by any user other than the current user when shared on a project server
Declaration
public bool IsCheckedOutToAnotherUser { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsCheckedOutToMe
Set to true if the file is checked out to the currently logged in user when shared on a project server
Declaration
public bool IsCheckedOutToMe { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSource
Gets whether this file is a source language or target language file.
Declaration
public bool IsSource { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Language
Gets the project language with which this file is associated.
Declaration
public Language Language { get; }
Property Value
| Type | Description |
|---|---|
| Language |
LastModified
The Last Date Time when the file was modified
Declaration
public DateTime LastModified { get; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
LatestServerVersion
The latest version of this file that is stored on the project server
Declaration
public int LatestServerVersion { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
LocalFilePath
Returns the local file path where this file resides.
Declaration
public string LocalFilePath { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
LocalFileState
The status of the local file in relation to the file stored on a project server
Declaration
public LocalFileState LocalFileState { get; }
Property Value
| Type | Description |
|---|---|
| LocalFileState |
Name
Gets the file name of the current version of this file.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
OriginalName
Original file name
Declaration
public string OriginalName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
PathInProject
Relative Path to the Project
Declaration
public string PathInProject { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ProjectId
Gets the unique ID of the project to which the file belongs.
Declaration
public Guid ProjectId { get; }
Property Value
| Type | Description |
|---|---|
| System.Guid |
Role
Gets the file role, which indicates how the file should be treated in the project.
Declaration
public FileRole Role { get; }
Property Value
| Type | Description |
|---|---|
| FileRole |
Remarks
Use SetFileRole(Guid[], FileRole) to change the role of a file.
Size
Size of the File
Declaration
public long Size { get; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
SourceFile
If this is a target language file, gets the corresponding source language file. Returns
null for source language files.
Declaration
public ProjectFile SourceFile { get; }
Property Value
| Type | Description |
|---|---|
| ProjectFile |
TargetFiles
If this is a source language file, returns all the corresponding target language files.
Returns null for target language files.
Declaration
public ProjectFile[] TargetFiles { get; }
Property Value
| Type | Description |
|---|---|
| ProjectFile[] |
Methods
GetSettings()
Gets the project-level settings.
Declaration
public ISettingsBundle GetSettings()
Returns
| Type | Description |
|---|---|
| ISettingsBundle | A settings bundle containing the project settings. Never returns |
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.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |