Class TranslationMemoryContainer
Represents a database using for storing server-based translation memories.
Inheritance
Implements
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
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 |
---|---|
System.ArgumentNullException | Thrown when |
Properties
DatabaseName
Gets or sets the database name.
Declaration
public string DatabaseName { get; set; }
Property Value
Type | Description |
---|---|
System.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. |
System.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
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. |
System.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
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.String |
Id
Gets the unique ID for this database server.
Declaration
public Guid Id { get; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.Boolean |
IsDirty
Returns
true
if this container has unsaved changes.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsNewObject
Gets a value indicating whether this instance is new object.
Declaration
public bool IsNewObject { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
LinkedResourceGroupPaths
Gets the collection of paths for the linked resource groups.
Declaration
public string[] LinkedResourceGroupPaths { get; set; }
Property Value
Type | Description |
---|---|
System.String[] |
Name
Gets or sets the friendly name of the container.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.String |
ParentResourceGroupName
Gets the parent resource group name.
Declaration
public string ParentResourceGroupName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ParentResourceGroupPath
Gets or sets the parent resource group path.
Declaration
public string ParentResourceGroupPath { get; set; }
Property Value
Type | Description |
---|---|
System.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
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<ServerBasedTranslationMemory> |
TranslationMemoryNames
Returns the list of translation memory names in this container.
Declaration
public IList<string> TranslationMemoryNames { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.String> |
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
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
System.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(Boolean)
Deletes this translation memory container.
Declaration
public void Delete(bool deleteContainerDatabase)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | deleteContainerDatabase | Whether to delete the physical container database. When , this just unregisters the
container from the system.
|
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 |
---|---|
System.Boolean | true if the current object is equal to the |
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
HasPermission(String)
Gets whether this object has the permission with the specified name.
Declaration
public bool HasPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
System.String | permission | The permission name. |
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|
System.ComponentModel.PropertyChangedEventHandler |