Class TranslationMemoryContainer
Represents a database using for storing server-based translation memories.
Implements
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class TranslationMemoryContainer : IEditableObject, INotifyPropertyChanged, IEquatable<TranslationMemoryContainer>, IPermissionCheck
Constructors
TranslationMemoryContainer(TranslationProviderServer)
Creates a new translation memory container. Note that you have to call Save() to persist the container object, after setting all the required properties.
Declaration
public TranslationMemoryContainer(TranslationProviderServer server)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderServer | server | The translation provider server with which the container should be registered. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |
Properties
DatabaseName
Gets or sets the database name.
Declaration
[Required(ErrorMessage = "Required Field")]
[RegularExpression("^[\\p{L}_][\\w_@#\\$]*$", ErrorMessage = "Only alpha-numeric and underscore characters allowed.")]
[StringLength(123, ErrorMessage = "Database Name cannot exceed 123 characters.")]
public string DatabaseName { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
If the database does not exist yet, it will be created automatically. If the database already exists, it will be registered with the system, together with any translation memories it contains.
Exceptions
Type | Condition |
---|---|
NullPropertyException | Thrown when trying to set this property to null or an empty string. |
InvalidOperationException | Thrown when trying to set this property after initial creation of the database server. |
ObjectDeletedException | Thrown when trying to get/set DatabaseName of an entity that no longer exists. |
DatabaseServer
Gets or sets the database server this container belongs to.
Declaration
[Required(ErrorMessage = "You must select a database server")]
public DatabaseServer DatabaseServer { get; set; }
Property Value
Type | Description |
---|---|
DatabaseServer |
Exceptions
Type | Condition |
---|---|
NullPropertyException | Thrown when trying to set this property to null or is already null. |
InvalidOperationException | Thrown when trying to set this property after initial creation of the database server. |
Description
Gets or sets the description of the container.
Declaration
[StringLength(255, ErrorMessage = "Description too long!")]
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string | The description. |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get/set description of an entity that no longer exists. |
DisplayText
Returns the human readable string of the TM container.
Declaration
public string DisplayText { get; }
Property Value
Type | Description |
---|---|
string |
Id
Gets the unique ID for this database server.
Declaration
public Guid Id { get; }
Property Value
Type | Description |
---|---|
Guid |
Remarks
This is auto-generated by the system when the container is created.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get the ID of an entity that no longer exists. |
IsDeleted
Returns
true
if this translation memory has been deleted.
Declaration
public bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
bool |
IsDirty
Returns
true
if this container has unsaved changes.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
IsNewObject
Gets a value indicating whether this instance is new object.
Declaration
public bool IsNewObject { get; }
Property Value
Type | Description |
---|---|
bool |
|
LinkedResourceGroupPaths
Gets the collection of paths for the linked resource groups.
Declaration
public string[] LinkedResourceGroupPaths { get; set; }
Property Value
Type | Description |
---|---|
string |
Name
Gets or sets the friendly name of the container.
Declaration
[Required(ErrorMessage = "Required Field")]
[RegularExpression("[^\\\\/\"<>\\|\\*\\?%]+", ErrorMessage = "The following characters ^ \\ / \\\" < > | * ? % are not allowed")]
[StringLength(50, ErrorMessage = "Name cannot exceed 50 characters.")]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get/set name of an entity that no longer exists. |
ParentResourceGroupDescription
Gets the parent resource group description.
Declaration
public string ParentResourceGroupDescription { get; set; }
Property Value
Type | Description |
---|---|
string |
ParentResourceGroupName
Gets the parent resource group name.
Declaration
public string ParentResourceGroupName { get; set; }
Property Value
Type | Description |
---|---|
string |
ParentResourceGroupPath
Gets or sets the parent resource group path.
Declaration
[Required(ErrorMessage = "Required Field")]
public string ParentResourceGroupPath { get; set; }
Property Value
Type | Description |
---|---|
string | The parent resource group path. |
Password
Gets or sets the password for the user name specified in UserName that is used for TM container.
Declaration
[Required(ErrorMessage = "Required Field")]
[StringLength(30, ErrorMessage = "Password too long!")]
public string Password { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
The password is only used when ServerType is set to Oracle.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to set Password of an entity that no longer exists. |
TranslationMemories
Gets the translation memories in this container.
Declaration
public ReadOnlyCollection<ServerBasedTranslationMemory> TranslationMemories { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollectionServerBasedTranslationMemory |
TranslationMemoryNames
Returns the list of translation memory names in this container.
Declaration
public IList<string> TranslationMemoryNames { get; }
Property Value
Type | Description |
---|---|
IListstring |
TranslationProviderServer
Gets the server.
Declaration
public TranslationProviderServer TranslationProviderServer { get; }
Property Value
Type | Description |
---|---|
TranslationProviderServer |
UserName
Gets or sets the user name used for TM container together with the password specified in Password.
Declaration
[Required(ErrorMessage = "Required Field")]
[StringLength(30, ErrorMessage = "User Name too long!")]
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
The user name is only used when ServerType is set to Oracle.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to set UserName of an entity that no longer exists. |
Methods
Delete()
Deletes this translation memory container.
Declaration
public void Delete()
Remarks
Note that this automatically updates the Containers collection if that has been loaded already.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
ObjectNotSavedException | Thrown when this object has not been initially saved yet. |
Equals(TranslationMemoryContainer)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(TranslationMemoryContainer other)
Parameters
Type | Name | Description |
---|---|---|
TranslationMemoryContainer | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
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
HasPermission(string)
Gets whether this object has the permission with the specified name.
Declaration
public bool HasPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
string | permission | The permission name. |
Returns
Type | Description |
---|---|
bool | is the object has the specified permission. |
LoadTranslationMemoryNames()
Initializes the lazy TranslationMemoryNames property.
Declaration
public void LoadTranslationMemoryNames()
Save()
Saves this container.
Declaration
public void Save()
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
PropertyChangedEventHandler |