Class TranslationProviderUriBuilder
A utility class that allows translation providers that implement the ITranslationProvider interface to return Uri values that confirm to the suggested Uri scheme.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class TranslationProviderUriBuilder
Constructors
TranslationProviderUriBuilder()
Constructs an empty TranslationMemoryUriBuilder class.
Declaration
public TranslationProviderUriBuilder()
TranslationProviderUriBuilder(string)
Constructs a TranslationMemoryUriBuilder class of the given type.
Declaration
public TranslationProviderUriBuilder(string type)
Parameters
Type | Name | Description |
---|---|---|
string | type |
TranslationProviderUriBuilder(string, string)
Constructs a TranslationMemoryUriBuilder class using the given type and protocol.
Declaration
public TranslationProviderUriBuilder(string type, string protocol)
Parameters
Type | Name | Description |
---|---|---|
string | type | A type string which is used together with the protocol string to uniquely identify a translation provider. You may wish to use your company name or initials as part of this unique identifier. This must not contain the "." character and must not be equal to "file" as this is not compatible with the Translation Provider Uri Schema. |
string | protocol | A protocol string used together with the type parameter to uniquely identify a translation provider. |
Remarks
If the protocol value is set to the special value "file" then this will have an effect on how the Resource property is stored. For "file" protocols the Resource property will always be converted back to a local Windows file format with server path separation characters '/' replaced by local file path separating characters ''.
TranslationProviderUriBuilder(Uri)
Constructs a TranslationMemoryUriBuilder class from the given Uri and also setting a flag to say if the Uri will be used to contain a Windows filename.
Declaration
public TranslationProviderUriBuilder(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri |
Properties
HostName
An optional host name.
Declaration
public string HostName { get; set; }
Property Value
Type | Description |
---|---|
string |
this[string]
A string indexer that allows any number of key/value pairs to used as Uri parameters.
Declaration
public string this[string propertyName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | propertyName |
Property Value
Type | Description |
---|---|
string |
Password
An optional password. NB: This password will not be encrypted.
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
If you need to protect a password then you should not set a password in the Uri property but use the ITranslationProviderCredentialStore in your translation provider factory.
Port
An optional port.
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
int |
Protocol
The protocol that is used.
Declaration
public string Protocol { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
If the protocol value is set to the special value "file" then this will have an effect on how the Resource property is stored. For "file" protocols the Resource property will always be converted back to a local Windows file format with server path separation characters '/' replaced by local file path separating characters ''.
Resource
An optional resource string.
Declaration
public string Resource { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
This string which may contain any number of '/' characters will be written directly to the Uri so the the string must be compatible with the Uri format. However, if the Protocol value is set to the special value "file" then this will have an effect on how this Resource property is stored. For "file" protocols the Resource property will always be converted back to a local Windows file format with server path separation characters '/' replaced by local file path separating characters ''.
Type
The type of the translation provider. This type must be unique for all installed translation providers.
Declaration
public string Type { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
You may wish to use your company name or other unique name as part of the the type string.
Uri
Returns the Uri built from the properties of this class.
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
Uri |
UserName
An optional UserName.
Declaration
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Exceptions
Type | Condition |
---|---|
NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
GetParameterKeys()
Returns an array of parameter key names that have values defined for them.
Declaration
public string[] GetParameterKeys()
Returns
Type | Description |
---|---|
string |
Remarks
This array does not contain entries for "userName" or "password" values.
ParseUri(Uri)
Initializes the TranslationMemoryUriBuilder class from the given Uri.
Declaration
public void ParseUri(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri |
ToString()
Creates a string representing the Uri
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |