Class ServerBasedLanguageResourcesTemplate
Represents a ILanguageResourcesTemplate which is stored on a server.
Implements
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class ServerBasedLanguageResourcesTemplate : ILanguageResourcesTemplate, ISupportPlaceables, INotifyPropertyChanged, IEquatable<ServerBasedLanguageResourcesTemplate>, IEditableObject, IPermissionCheck
Constructors
ServerBasedLanguageResourcesTemplate(TranslationProviderServer)
Creates a new, empty language resources template.
Declaration
public ServerBasedLanguageResourcesTemplate(TranslationProviderServer server)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderServer | server | The server on which to create the language resources template. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Properties
Description
Gets or sets the description of this language resources template.
Declaration
[StringLength(255, ErrorMessage = "Description too long!")]
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Note that you have to call Save() to persists the change after setting this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get or set the description of an entity that no longer exists. |
Id
Gets the unique ID of this language resources template.
Declaration
public Guid Id { get; }
Property Value
Type | Description |
---|---|
Guid |
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 language resources template has unsaved changes.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
IsNewObject
Returns
true
if this language resources template has not been saved yet.
Declaration
public bool IsNewObject { get; }
Property Value
Type | Description |
---|---|
bool |
LanguageResourceBundles
Gets the language resources bundles contained in this template.
Declaration
public LanguageResourceBundleCollection LanguageResourceBundles { get; }
Property Value
Type | Description |
---|---|
LanguageResourceBundleCollection |
Remarks
Note that you have to call Save() to persist any changes made to language resources.
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 name of this language resources template.
Declaration
[Required(ErrorMessage = "Required Field")]
[RegularExpression("[^\\\\/\"<>\\|\\*\\?%]+", ErrorMessage = "The following characters ^ \\ / \\\" < > | * ? % are not allowed")]
[StringLength(50, ErrorMessage = "Name too long!")]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Note that you have to call Save() to persists the change after setting this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get or set the 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 the parent resource group path.
Declaration
[Required(ErrorMessage = "Required Field")]
public string ParentResourceGroupPath { get; set; }
Property Value
Type | Description |
---|---|
string |
Recognizers
Gets or sets the recognizers which are enabled for this TM.
Declaration
public BuiltinRecognizers Recognizers { get; set; }
Property Value
Type | Description |
---|---|
BuiltinRecognizers |
TokenizerFlags
Gets or sets the flags affecting tokenizer behaviour for this language resource template.
Declaration
public TokenizerFlags? TokenizerFlags { get; set; }
Property Value
Type | Description |
---|---|
TokenizerFlags |
TranslationMemories
Gets the collection of translation memories associated with this language resources template.
Declaration
public ReadOnlyCollection<ServerBasedTranslationMemory> TranslationMemories { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollectionServerBasedTranslationMemory |
Remarks
If the list of translation memories has been pre-loaded, the in-memory collection of translation memories is returned, otherwise returns null
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
TranslationProviderServer
Gets the server.
Declaration
public TranslationProviderServer TranslationProviderServer { get; }
Property Value
Type | Description |
---|---|
TranslationProviderServer |
WordCountFlags
Gets or sets the flags affecting word count behaviour for this language resource template.
Declaration
public WordCountFlags? WordCountFlags { get; set; }
Property Value
Type | Description |
---|---|
WordCountFlags |
Methods
Delete()
Deletes this language resources template.
Declaration
public void Delete()
Remarks
If any translation memories are currently associated with the language resources template, the language resources of these translation memories will not be affected.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
ObjectNotSavedException | Thrown when this object has not been initially saved yet. |
Equals(ServerBasedLanguageResourcesTemplate)
Returns true if this template has the same Id as the specified template.
Declaration
public bool Equals(ServerBasedLanguageResourcesTemplate other)
Parameters
Type | Name | Description |
---|---|---|
ServerBasedLanguageResourcesTemplate | other | A template to compare to. |
Returns
Type | Description |
---|---|
bool | True if this template has the same Id as the specified template. |
Equals(object)
Returns true if this language resources template has the same Id as the specified language resources template.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | A language resources template to compare to. |
Returns
Type | Description |
---|---|
bool | True if this language resources template has the same Id as the specified language resources template. |
Overrides
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. |
Save()
Saves this language resources template, including any changes to its language resource bundles.
Declaration
public void Save()
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |