Class GenericCredentials
A generic class for building and parsing a credentials string. This will usually contain a UserName and Password but may also contain other parameters using an indexer on this class.
Inheritance
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class GenericCredentials
Constructors
GenericCredentials(String)
Constructs a GenericCredentials class from a credentials string previously created by another instance of this class.
Declaration
public GenericCredentials(string credentialString)
Parameters
Type | Name | Description |
---|---|---|
System.String | credentialString |
GenericCredentials(String, String)
Constructs a GenericCredentials class from a UserName and Password string.
Declaration
public GenericCredentials(string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | |
System.String | password |
Properties
Item[String]
A string indexer that allows any number of key/value pairs to used in a credentials store.
Declaration
public string this[string propertyName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
Property Value
Type | Description |
---|---|
System.String |
Password
The Password to be used in a credentials store - if null, then no password is specified.
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PropertyKeys
Returns an array of property key names that have values defined for them.
Declaration
public string[] PropertyKeys { get; }
Property Value
Type | Description |
---|---|
System.String[] |
Remarks
This array does not contain entries for "userName" or "password" values.
UserName
The UserName to be used in a credentials store - if null, then no username is specified.
Declaration
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
ToCredentialString()
Returns a string containing a UserName and Password and any other defined parameters that can be used in a credentials store.
Declaration
public string ToCredentialString()
Returns
Type | Description |
---|---|
System.String | The credential string representation. |
ToString()
Returns the string representation of the credentials. See ToCredentialString().
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The credential string representation. |