Interface ITranslationProviderFactory
This interface defines a Translation Provider Factory class that can be used as a plug-in based on the Sdl.Core.PluginFramework Extensions API
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public interface ITranslationProviderFactory
Remarks
Implementations of this class should be marked up with a TranslationProviderFactoryAttribute extension attribute in order for the factory to be available.
Methods
CreateTranslationProvider(Uri, String, ITranslationProviderCredentialStore)
Creates an instance of the translation provider defined by the specified URI.
Declaration
ITranslationProvider CreateTranslationProvider(Uri translationProviderUri, string translationProviderState, ITranslationProviderCredentialStore credentialStore)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | translationProviderUri | A URI that identifies the translation provider to create. |
System.String | translationProviderState | Serialized state information that should be used for configuring the translation provider. This is typically state information that was previously saved by calling SerializeState(). |
ITranslationProviderCredentialStore | credentialStore | A credential store object that can be used to retrieve credentials required for this translation provider. |
Returns
Type | Description |
---|---|
ITranslationProvider | A new translation provider object, ready to be used. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
System.ArgumentException | Thrown if |
System.ArgumentException | Thrown if |
TranslationProviderAuthenticationException | Thrown when no appropriate credentials are available in the credential store. |
GetTranslationProviderInfo(Uri, String)
Gets general information for the specified translation provider.
Declaration
TranslationProviderInfo GetTranslationProviderInfo(Uri translationProviderUri, string translationProviderState)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | translationProviderUri | A translation provider URI, representing the translation provider. |
System.String | translationProviderState | Optional translation provider state information, which can be used to determine certain aspects of the general information. |
Returns
Type | Description |
---|---|
TranslationProviderInfo | A TranslationProviderInfo object, containing general information that allows an application to query the translation provider without having to instantiate it. |
Remarks
Note that this method can potentially be called very frequently so it is not advisable to instantiate the translation provider within its implementation.
SupportsTranslationProviderUri(Uri)
Returns true if this factory supports the specified URI.
Declaration
bool SupportsTranslationProviderUri(Uri translationProviderUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | translationProviderUri | The Uri. |
Returns
Type | Description |
---|---|
System.Boolean | True if this factory supports the specified URI. |