Class FileBasedLanguageResourcesTemplate
A language resources template implementation (ILanguage
Inheritance
Implements
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class FileBasedLanguageResourcesTemplate : ILanguageResourcesTemplate
Constructors
FileBasedLanguageResourcesTemplate()
Creates a new file-based language resources template.
Declaration
public FileBasedLanguageResourcesTemplate()
FileBasedLanguageResourcesTemplate(Guid)
Creates a new file-based language resources template with the provided ID. This is useful during copying.
Declaration
public FileBasedLanguageResourcesTemplate(Guid id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id |
FileBasedLanguageResourcesTemplate(String)
Loads a file-based language resources template from the specified file.
Declaration
public FileBasedLanguageResourcesTemplate(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
filePath | The location where the template should be loaded from. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when |
System. |
Thrown if |
Properties
Description
Gets or sets the description of this template.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System. |
FilePath
Gets the location where this language resources template is located.
Declaration
public string FilePath { get; }
Property Value
Type | Description |
---|---|
System. |
Id
gets the unique id of this template.
Declaration
public Guid Id { get; set; }
Property Value
Type | Description |
---|---|
System. |
LanguageResourceBundles
Gets the collection of language resource bundles in this template.
Declaration
public LanguageResourceBundleCollection LanguageResourceBundles { get; }
Property Value
Type | Description |
---|---|
Language |
Name
Gets or sets the name of this template. Not that this is not necessarily the same as the file name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
Refresh()
Reloads the template from the file.
Declaration
public void Refresh()
Exceptions
Type | Condition |
---|---|
System. |
Thrown when trying to call this method on an unsaved template. |
Save()
Saves the template to the location specified in File
Declaration
public void Save()
Exceptions
Type | Condition |
---|---|
System. |
Thrown if this template has not been saved before. Use SaveAs and specify a file path instead. |
Save(Stream)
Saves this template to the specified stream.
Declaration
public void Save(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | The stream to which the template should be saved. |
SaveAs(String)
Saves the template to the specified location. This also updates the current File
Declaration
public void SaveAs(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
filePath | The location to save the template to. |
Exceptions
Type | Condition |
---|---|
System. |
Thrown when |