| IFileTypeManagerGetConverterToBilingual Method (String, IBilingualDocumentGenerator, BilingualDocumentOutputPropertiesProvider, CultureInfo, Codepage, EventHandlerMessageEventArgs) |
Creates and initializes a file converter using the filters that best match a set of native files.
The file converter can then be used to process all of the files as one document. The specified
bilingual writer will be used for output.
The file type definitions are tested in sequence, and the first file type definition that
matches a file is used for each file. The following steps are used to determine if
a file type definition matches a file:
- The regular expression is evaluated against the name of the file to be converted. If it does not match,
the file type definition is not used.
- If a file sniffer is defined for the file type definition, it gets applied to the file. If the file sniffer
does not indicate that the file is supported, the file type definition is not used.
If no matching file type definition is found, a
OneOrMoreFilesNotSupportedException is thrown.
Namespace: Sdl.FileTypeSupport.Framework.IntegrationApiAssembly: Sdl.FileTypeSupport.Framework.Core (in Sdl.FileTypeSupport.Framework.Core.dll) Version: 1.0.0.0 (1.0.2551.0)
SyntaxIMultiFileConverter GetConverterToBilingual(
string[] nativeFilePaths,
IBilingualDocumentGenerator writer,
BilingualDocumentOutputPropertiesProvider outputSettingsProvider,
CultureInfo sourceLanguage,
Codepage suggestedCodepage,
EventHandler<MessageEventArgs> messageHandler
)
Function GetConverterToBilingual (
nativeFilePaths As String(),
writer As IBilingualDocumentGenerator,
outputSettingsProvider As BilingualDocumentOutputPropertiesProvider,
sourceLanguage As CultureInfo,
suggestedCodepage As Codepage,
messageHandler As EventHandler(Of MessageEventArgs)
) As IMultiFileConverter
IMultiFileConverter^ GetConverterToBilingual(
array<String^>^ nativeFilePaths,
IBilingualDocumentGenerator^ writer,
BilingualDocumentOutputPropertiesProvider^ outputSettingsProvider,
CultureInfo^ sourceLanguage,
Codepage^ suggestedCodepage,
EventHandler<MessageEventArgs^>^ messageHandler
)
abstract GetConverterToBilingual :
nativeFilePaths : string[] *
writer : IBilingualDocumentGenerator *
outputSettingsProvider : BilingualDocumentOutputPropertiesProvider *
sourceLanguage : CultureInfo *
suggestedCodepage : Codepage *
messageHandler : EventHandler<MessageEventArgs> -> IMultiFileConverter
Parameters
- nativeFilePaths
- Type: SystemString
The native files to be converted - writer
- Type: Sdl.FileTypeSupport.Framework.IntegrationApiIBilingualDocumentGenerator
Bilingual writer to use as output with the converter - outputSettingsProvider
- Type: Sdl.FileTypeSupport.Framework.IntegrationApiBilingualDocumentOutputPropertiesProvider
Implementation of the output settings provider for bilingual
document files. Will be passed to the multi-file converter and used for writing bilingual document files.
If the bilingual document generator does not have a bilingual document file writer, you can pass null
as parameter. - sourceLanguage
- Type: System.GlobalizationCultureInfo
Expected source language of the files.
The same source (and target) language must be used for all the files processed with a single converter instance.
If the language can be determined automatically
from the content of the file (e.g. when reading a bilingual format such as TTX), this parameter may be ignored by the parser.
If this parameter is left undefined, it is up to the file sniffer and/or parser to try to determine the
language. Parser components may report an error or a warning if they cannot reliably identify the language.
- suggestedCodepage
- Type: Sdl.Core.GlobalizationCodepage
A rough guess on what encoding the files use. This is normally set to the default code page
for the language, but can also be null. This serves only as a hint. A file sniffer can be used to determine the actual encoding for each file. An
undefined codepage object can be used if no encoding can be guessed. It is then up to the file sniffer and/or parser
to best determine the encoding, and report an error if they fail or a warning if the result is not definite.
- messageHandler
- Type: SystemEventHandlerMessageEventArgs
An (optional) message handler implementation that will receive any messages reported
from file sniffers invoked in the process. If a converter is returned, this message handler will also
be connected to the Message event on the converter. You may specify null for this parameter.
Return Value
Type:
IMultiFileConverterA file converter object initialized to read the files, based on information from the best matching file type definitions.
To use the file converter, add your own bilingual processors to the converter and call
Parse or
ParseNext to process the native files.
Exceptions
Remarks
See Also
Comments