Interface IPersistentFileConversionProperties
File-level properties that are guaranteed to be preserved (if necessary persisted to an intermediate bilingual file format) during different stages of the content processing lifecycle; passed to native content processors, parsers and writers that implement INativeContentCycleAware.
Components can set these properties during parsing, and they will be made available when generating the translated output, or during any other operation used to process content.
Custom properties can be stored as metadata key/value pairs through the IMetaDataContainer implementation. It is recommended that keys are prefixed with a value that is likely to be unique in order to avoid conflicts with unrelated components.
Inherited Members
Namespace: SdlSdl.FileTypeSupportFrameworkNativeApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public interface IPersistentFileConversionProperties : IMetaDataContainer, ICloneable
Remarks
Components can retrieve these properties by implementing INativeContentCycleAware. The framework calls SetFileProperties(IFileProperties) to pass the properties.
All metadata stored by SDL components use keys prefixed "SDL:".
Keys for a number of published file properties used by certain SDL components
are defined in Sdl.FileTypeSupport.Framework.Core.Utilities.NativeApi.DefaultPersistentFilePropertiesKeys
.
Properties
CreationDate
The time of the original conversion
Declaration
DateTime CreationDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
CreationTool
The name of the tool used for the conversion
Declaration
string CreationTool { get; set; }
Property Value
Type | Description |
---|---|
string |
CreationToolVersion
The version number of the tool used for the conversion
Declaration
string CreationToolVersion { get; set; }
Property Value
Type | Description |
---|---|
string |
DependencyFiles
The dependency files used or created while parsing.
Declaration
IList<IDependencyFileProperties> DependencyFiles { get; }
Property Value
Type | Description |
---|---|
IListIDependencyFileProperties |
Remarks
The set of dependency files can change while parsing, but should not change after the EndOfInput() call.
Any dependency files reported by a parser or file type component when parsing a native file will be passed through this property when writing the native file.
FileId
Unique identifier for this file; can be used to unambigously identify the file in a bilingual document with multiple files.
Declaration
FileId FileId { get; set; }
Property Value
Type | Description |
---|---|
FileId |
Remarks
This is set by the framework, and should typically never need to be changed.
FileSnifferInfo
Properties determined during successful identification of this file type
Declaration
SniffInfo FileSnifferInfo { get; set; }
Property Value
Type | Description |
---|---|
SniffInfo |
FileTypeDefinitionId
The unique identifier for the file type definition used in this conversion.
Declaration
FileTypeDefinitionId FileTypeDefinitionId { get; set; }
Property Value
Type | Description |
---|---|
FileTypeDefinitionId |
Remarks
Can be used to identify the file type.
InputFilePath
Full path to the file that should be used as source for the parser.
Declaration
string InputFilePath { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Usually, this will be the same as OriginalFilePath, but under some circumstances (e.g. file tweaking) there may be an alternative input file produced.
this[string]
Convenience getter and setter for metadata using indexer syntax.
The getter functionality is equivalent to calling SetMetaData(string, string), and setter functionality is equivalent to GetMetaData(string).
Declaration
string this[string key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | key | Must not be |
Property Value
Type | Description |
---|---|
string | The corresponding value, or |
OriginalEncoding
The original encoding of the native source language file from which the content originates
Declaration
Codepage OriginalEncoding { get; set; }
Property Value
Type | Description |
---|---|
Codepage |
OriginalFilePath
Full path name to the native file the content originates from.
Declaration
string OriginalFilePath { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Usually, this is the same as the InputFilePath, but it can be different, e.g. if file tweaking has been applied.
PreferredTargetEncoding
If set, indicates the preferred codepage that the target language file should be in. You can test the IsValid property of the returned codepage to find out if it has been set.
This property can be used during editing to warn the user when they try to use characters in the translation that are not supported by the given codepage.
If this property is set when writing the target language version of the file, it may be used by the native file writer (though it is ultimately up to the file writer to decide).
Declaration
Codepage PreferredTargetEncoding { get; set; }
Property Value
Type | Description |
---|---|
Codepage |
SourceLanguage
Original source language of the content
Declaration
Language SourceLanguage { get; set; }
Property Value
Type | Description |
---|---|
Language |
TargetLanguage
Target language into which the content is being translated into.
Declaration
Language TargetLanguage { get; set; }
Property Value
Type | Description |
---|---|
Language |
Remarks
The target language is typically not set until the file is being translated. You can test the Language.IsValid property of the target language to find out if it has been set.