Class EditScript
An edit script is an ordered collection of edit actions which can be applied to a translation unit.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryEditScripts
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
[DataContract]
public class EditScript
Constructors
EditScript()
Declaration
public EditScript()
Properties
Actions
Gets or sets the collection of edit actions.
Declaration
[DataMember]
public List<EditAction> Actions { get; set; }
Property Value
Type | Description |
---|---|
ListEditAction |
Continuation
Gets or sets a value which indicates how to continue with the edit script once an action has been applied successfully.
Declaration
[DataMember]
public Continuation Continuation { get; set; }
Property Value
Type | Description |
---|---|
Continuation |
Filter
Gets or sets a filter condition. If non-null, the edit script will only be applied to TUs which match the filter.
Declaration
[DataMember]
public FilterExpression Filter { get; set; }
Property Value
Type | Description |
---|---|
FilterExpression |
Methods
Add(EditAction)
Adds the provided action to the list of edit script actions.
Declaration
public void Add(EditAction action)
Parameters
Type | Name | Description |
---|---|---|
EditAction | action | The action to add |
Clear()
Clears all actions in the script.
Declaration
public void Clear()
Load(Stream)
Loads an edit script from the specified stream.
Declaration
public static EditScript Load(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to read the data from |
Returns
Type | Description |
---|---|
EditScript | The edit script loaded from the specified stream. |
Load(string)
Loads an edit script from the specified file name.
Declaration
public static EditScript Load(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The file name to load the data from. |
Returns
Type | Description |
---|---|
EditScript | The edit script stored in the specified file. |
Save(Stream)
Serializes the edit script to the specified output stream.
Declaration
public void Save(Stream outputStream)
Parameters
Type | Name | Description |
---|---|---|
Stream | outputStream | The output stream. |
Save(string)
Saves the edit script in the specified file.
Declaration
public void Save(string fileName)
Parameters
Type | Name | Description |
---|---|---|
string | fileName | The file name to save the script in. Existing files will be overwritten. |
Validate(IFieldDefinitions, bool)
Validates the edit script against the provided field definitions.
Declaration
public bool Validate(IFieldDefinitions fields, bool throwIfInvalid)
Parameters
Type | Name | Description |
---|---|---|
IFieldDefinitions | fields | The field definitions to validate against. |
bool | throwIfInvalid | If true, an exception will be thrown if invalid field names or other issues are encountered. If false, the return value will be set to false without an exception being thrown. |
Returns
Type | Description |
---|---|
bool | true if the edit script is valid, given the provided field definitions. false otherwise. |