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).
Inheritance
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
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 |
---|---|---|
System.Uri | translationProviderUri | A translation provider URI (see Uri). |
System.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 |
---|---|
System.ArgumentNullException | Thrown if |
System.ArgumentException | Thrown if |
System.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 |
---|---|
System.Collections.Generic.IList<ITranslationProviderFactory> | 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 |
---|---|---|
System.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 |
---|---|---|
System.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 |
---|---|
System.Collections.Generic.IList<ITranslationProviderWinFormsUI> | 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.