Class TranslationProviderManager
This class exposes functionality to work with translation provider plug-ins (ITranslationProvider) in a generic way. It allows creating translation providers in a generic way and also allows creating user interface components to manipulate translation provider settings (ITranslationProviderWinFormsUI).
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class TranslationProviderManager
Constructors
TranslationProviderManager()
Initializes a new instance of the TranslationProviderManager class.
Declaration
public TranslationProviderManager()
Methods
CreateTranslationProvider(Uri, string, ITranslationProviderCredentialStore)
Creates a new translation provider for a given URI by selecting the appropriate factory (ITranslationProviderFactory).
Declaration
public ITranslationProvider CreateTranslationProvider(Uri translationProviderUri, string translationProviderState, ITranslationProviderCredentialStore credentialStore)
Parameters
Type | Name | Description |
---|---|---|
Uri | translationProviderUri | A translation provider URI (see Uri). |
string | translationProviderState | Serialized state information to be loaded into the translation provider after instantiation (see LoadState(string) and SerializeState()). |
ITranslationProviderCredentialStore | credentialStore | A credential store object, which provides the relevant translation provider factory with the required credentials need to instantiate the translation provider. |
Returns
Type | Description |
---|---|
ITranslationProvider |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ArgumentException | Thrown if |
ArgumentException | Thrown if |
TranslationProviderAuthenticationException | Thrown when no credentials are available and no UI can be shown, or if the credentials provided by the user are invalid. |
GetTranslationProviderFactories()
Gets a list of all available translation provider factories.
Declaration
public static IList<ITranslationProviderFactory> GetTranslationProviderFactories()
Returns
Type | Description |
---|---|
IListITranslationProviderFactory | A list of all available translation provider factories. |
Remarks
The factories returned are those that have been registered with the plug-in registry using the TranslationProviderFactoryAttribute attribute.
GetTranslationProviderFactory(Uri)
Gets the translation provider factory that supports the given translation provider uri.
Declaration
public static ITranslationProviderFactory GetTranslationProviderFactory(Uri translationProviderUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | translationProviderUri | translation provider uri |
Returns
Type | Description |
---|---|
ITranslationProviderFactory | translation provider factory |
GetTranslationProviderWinFormsUI(Uri)
Gets the translation provider win forms ui that supports the given translation provider uri.
Declaration
public static ITranslationProviderWinFormsUI GetTranslationProviderWinFormsUI(Uri translationProviderUri)
Parameters
Type | Name | Description |
---|---|---|
Uri | translationProviderUri | translation provider uri |
Returns
Type | Description |
---|---|
ITranslationProviderWinFormsUI | translation provider win forms ui |
GetTranslationProviderWinFormsUIs()
Gets a list of all available translation provider win form uis.
Declaration
public static IList<ITranslationProviderWinFormsUI> GetTranslationProviderWinFormsUIs()
Returns
Type | Description |
---|---|
IListITranslationProviderWinFormsUI | A list of all available translation provider win form uis. |
Remarks
The win form uis returned are those that have been registered with the plug-in registry using the TranslationProviderWinFormsUiAttribute attribute.