Interface IDependencyFileProperties
Information on a dependency file used during file conversion.
Inherited Members
Namespace: SdlSdl.FileTypeSupportFrameworkNativeApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public interface IDependencyFileProperties : ICloneable
Remarks
Some examples of dependency files include:
- The original native file, if needed for generation of translated native file.
- The Filter Framework 1 filter definition file, if required by Filter Framework 1 filter and adapter.
- Image files required to correctly display an HTML file during preview.
- An XML schema required for validation of the output.
- A translation memory that may be used during translation.
Dependency files are not processed for localizable content.
Information on dependency files is particularly important when moving bilingual documents between systems (or even between different locations on the same system). After saving a bilingual document LinkedDependencyFiles, this contains information on which dependency files (if any) were explicitly linked rather than embedded in the bilingual file.
Properties
CurrentFilePath
The current path to the dependency file
Declaration
string CurrentFilePath { get; set; }
Property Value
Type | Description |
---|---|
string |
Description
Optional clear text description of the file. This can be used e.g. to explain the origin and purpose of the file to other users and developers.
Declaration
string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
DisposableObject
This property can be used to hold a reference to a disposable object, such as a temp file that should be deleted when it has no more references. (optional)
Declaration
IDisposable DisposableObject { get; set; }
Property Value
Type | Description |
---|---|
IDisposable |
Remarks
You can assign a temp file object with a finalizer that deletes the temp file to
this property, and the file should be kept alive as long as anyone has
a reference to it (unless, of course, someone explicitly calls Dispose
on it).
Normally, users should NOT explicitly invoke Dispose
on this object,
as it may still be referenced by others. The IDisposable
interface
is used here mainly to indicate that the object is expected
to do some clean-up work at some point when it is no longer needed.
This property is (for obvious reasons) not serialized.
ExpectedUsage
Expected usage for this dependency file (optional)
Declaration
DependencyFileUsage ExpectedUsage { get; set; }
Property Value
Type | Description |
---|---|
DependencyFileUsage |
Remarks
This does not limit the possible usage of the file, it merely serves as a hint on what it is used for.
FileExists
True
if the CurrentFilePath references a file
that exists.
Declaration
bool FileExists { get; }
Property Value
Type | Description |
---|---|
bool |
Id
Id associated with this dependency file. (optional)
Declaration
string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Can be used by related file type components to ensure that they pick the right file to use for the right purpose.
To avoid interference between unrelated components working together it is recommended to use a URI as the id.
OriginalFilePath
The original path of the dependency file (if known)
Declaration
string OriginalFilePath { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Temporarily generated dependency files may not have an original file path.
OriginalLastChangeDate
The timestamp (the last change date) of the original dependency file (if known)
Declaration
DateTime OriginalLastChangeDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
PathRelativeToConverted
If the file is a direct dependency of the file being converted, and it is linked rather than embedded, then this property may contain the path to the linked dependency file relative to the .sdlxliff file that refers to it.
Declaration
string PathRelativeToConverted { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
This property can be null
if no relative path should be associated with
this dependency.
PreferredLinkage
Indicates the preferred way of handling this file when writing intermediate bilingual content. (optional)
Declaration
DependencyFileLinkOption PreferredLinkage { get; set; }
Property Value
Type | Description |
---|---|
DependencyFileLinkOption |
Remarks
Set this value e.g. to specifically request that the dependency file gets referenced as an external link rather than being embedded when saving to an intermediate bilingual format such as SDL XLIFF.
Note that this serves as a recommendation only, the writer is not required to honor this setting. For some file formats it may e.g. not be possible to embed dependency files. The host application needs to check the properties of the writer after conversion to find out which external dependencies it produced.
ZippedCurrentFile
A FileJanitor instance managing the lifetime of a temporary .zip file containing a copy of the file stored in CurrentFilePath.
Declaration
FileJanitor ZippedCurrentFile { get; }
Property Value
Type | Description |
---|---|
FileJanitor |
Remarks
The zipped file is generated on demand, and will also be deleted during garbage collection.