Interface IStudioDocument
Interface for the document implementation
Namespace: Sdl.TranslationStudioAutomation.IntegrationApi
Assembly: Sdl.TranslationStudioAutomation.IntegrationApi.dll
Syntax
public interface IStudioDocument
Properties
ActiveFile
Gets the active project file.
Declaration
ProjectFile ActiveFile { get; }
Property Value
Type | Description |
---|---|
ProjectFile |
ActiveFileProperties
Gets the active file properties
Declaration
IFileProperties ActiveFileProperties { get; }
Property Value
Type | Description |
---|---|
IFileProperties |
ActiveSegmentPair
Gets the active segment pair.
Declaration
ISegmentPair ActiveSegmentPair { get; }
Property Value
Type | Description |
---|---|
ISegmentPair |
DisplayFilter
Get the active Display Filter
The result will be null if the filter that has been applied on the document is derived from the internal provider. This should permit the developer to differentiate between the internal system filter provider and their own implementation and/or multiple implementations of the interface.
Declaration
IDisplayFilter DisplayFilter { get; }
Property Value
Type | Description |
---|---|
IDisplayFilter |
Files
Get the files of the document
Declaration
IEnumerable<ProjectFile> Files { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProjectFile> |
FilteredSegmentPairs
Get the filtered document segment pairs in a readonly mode
Declaration
IEnumerable<ISegmentPair> FilteredSegmentPairs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISegmentPair> |
FilteredSegmentPairsCount
The filtered document segment pairs count
Declaration
int FilteredSegmentPairsCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
FocusedDocumentContent
Gets the focus document content
Declaration
FocusedDocumentContent FocusedDocumentContent { get; }
Property Value
Type | Description |
---|---|
FocusedDocumentContent |
IsDirty
Returns true if the document has unsaved changes.
Declaration
bool IsDirty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsTranslationProviderAvailable
Get a boolean value that indicate if a Translation Provider is available.
Declaration
bool IsTranslationProviderAvailable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemFactory
Gets the factory for the document items
Declaration
IDocumentItemFactory ItemFactory { get; }
Property Value
Type | Description |
---|---|
IDocumentItemFactory |
Mode
Gets the editing mode of the document
Declaration
EditingMode Mode { get; }
Property Value
Type | Description |
---|---|
EditingMode |
Project
Gets the project of the document
Declaration
FileBasedProject Project { get; }
Property Value
Type | Description |
---|---|
FileBasedProject |
PropertiesFactory
Gets the factory for the item properties
Declaration
IPropertiesFactory PropertiesFactory { get; }
Property Value
Type | Description |
---|---|
IPropertiesFactory |
SegmentPairs
Get the document segment pairs in a readonly mode
Declaration
IEnumerable<ISegmentPair> SegmentPairs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISegmentPair> |
Selection
Gets the document selection
Declaration
DocumentSelection Selection { get; }
Property Value
Type | Description |
---|---|
DocumentSelection | The document selection. |
TotalSegmentPairsCount
The total document segment pairs count
Declaration
int TotalSegmentPairsCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
AcceptAllTrackedChanges(ConfirmationLevel)
Accepts all tracked changes and change the confirmation level if the new confirmation level is not Undefined
Declaration
void AcceptAllTrackedChanges(ConfirmationLevel newConfirmationLevel)
Parameters
Type | Name | Description |
---|---|---|
ConfirmationLevel | newConfirmationLevel | New confirmation level |
AddCommentOnSegment(ISegmentPair, String, Severity)
Adds a comment to the target segment
Declaration
void AddCommentOnSegment(ISegmentPair segmentPair, string text, Severity severity)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
System.String | text | Comment text |
Severity | severity | Comment severity level |
AddCommentOnTargetSelection(String, Severity)
Adds a comment to the selected content range in the target document.
Declaration
void AddCommentOnTargetSelection(string text, Severity severity)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Comment text |
Severity | severity | Comment severity level |
ApplyFilterOnSegments(IDisplayFilter)
Apply filter on the segments from the active document in the editor
Declaration
void ApplyFilterOnSegments(IDisplayFilter filter)
Parameters
Type | Name | Description |
---|---|---|
IDisplayFilter | filter | The implementation of the display filter interface |
ChangeConfirmationLevelOnSegment(ISegmentPair, ConfirmationLevel)
Sets the segment confirmation level to the specified value
Declaration
void ChangeConfirmationLevelOnSegment(ISegmentPair segmentPair, ConfirmationLevel newConfirmationLevel)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
ConfirmationLevel | newConfirmationLevel | The new confirmation level for the segment. |
ChangeTranslationOriginOnSegment(ISegmentPair, String)
Sets the translation origin for the specified segment to the specified origin type
Declaration
void ChangeTranslationOriginOnSegment(ISegmentPair segmentPair, string originType)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
System.String | originType | The translation origin type. This should normally be one of the constants define in DefaultTranslationOrigin. |
DeleteAllCommentsOnSegment(ISegmentPair)
Delete all comments from the target segment.
Declaration
void DeleteAllCommentsOnSegment(ISegmentPair segmentPair)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
DeleteAllCommentsWithoutNotification()
Delete all comments from active document and saves the document.
Declaration
void DeleteAllCommentsWithoutNotification()
DeleteCommentOnSegment(ISegmentPair, IComment)
Delete a specific comment from the target segment.
Declaration
void DeleteCommentOnSegment(ISegmentPair segmentPair, IComment commentToDelete)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
IComment | commentToDelete | Comment to be deleted |
FindTextInSegment(String, String, Boolean, Boolean)
Declaration
bool FindTextInSegment(string segmentNumber, string text, bool highlightText, bool searchInSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | segmentNumber | |
System.String | text | |
System.Boolean | highlightText | |
System.Boolean | searchInSource |
Returns
Type | Description |
---|---|
System.Boolean |
GetActiveSegmentPair()
Get the active segment pair in a readonly mode.
Declaration
ISegmentPair GetActiveSegmentPair()
Returns
Type | Description |
---|---|
ISegmentPair | The active segment pair or null if none was found. |
GetCommentsFromSegment(ISegmentPair)
Obtain all comments existing from the target segment
Declaration
IEnumerable<IComment> GetCommentsFromSegment(ISegmentPair segmentPair)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IComment> | A list of comments from the target segment |
GetParentParagraphUnit(ISegmentPair)
Declaration
IParagraphUnit GetParentParagraphUnit(ISegmentPair segmentPair)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair |
Returns
Type | Description |
---|---|
IParagraphUnit |
GetSegmentPair(Int32)
Get the segment pair from the row number
Declaration
ISegmentPair GetSegmentPair(int rowNumber)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowNumber | The row number |
Returns
Type | Description |
---|---|
ISegmentPair | The segment pair or null if none was found. |
GetSegmentPair(String, String)
Get the segment pair from the paragraph and segment id
Declaration
ISegmentPair GetSegmentPair(string paragraphUnitId, string segmentId)
Parameters
Type | Name | Description |
---|---|---|
System.String | paragraphUnitId | The paragraph unit id |
System.String | segmentId | The segment id |
Returns
Type | Description |
---|---|
ISegmentPair | The segment pair or null if none was found. |
GetSegmentPairsFromParagraph(ParagraphUnitId)
Get the segment pairs from a specific paragraph
Declaration
IEnumerable<ISegmentPair> GetSegmentPairsFromParagraph(ParagraphUnitId paragraphId)
Parameters
Type | Name | Description |
---|---|---|
ParagraphUnitId | paragraphId | Paragraph unique identifier |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISegmentPair> | A list of segment pairs from the provided paragraph |
GetSelectedSegmentPairs()
Obtain all selected segment pairs
Declaration
IEnumerable<ISegmentPair> GetSelectedSegmentPairs()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISegmentPair> | A list of selected segment pairs from the editor |
ProcessSegmentPair(ISegmentPair, String, Action<ISegmentPair, CancelEventArgs>)
Processing a single specific segment pair with the ability to alter the source and/or target
Declaration
void ProcessSegmentPair(ISegmentPair segmentPair, string processingName, Action<ISegmentPair, CancelEventArgs> process)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment Pair |
System.String | processingName | A custom provided name for the processing operation used for the undo history. |
System.Action<ISegmentPair, System.ComponentModel.CancelEventArgs> | process | Processing delegate responsable for analyzing the segment pair. |
Remarks
Even if the source is configured to be in the editable mode this will not be functional if the document does not allow it.
ProcessSegmentPairs(String, Action<ISegmentPair, CancelEventArgs>)
Processing the document segment pairs with the ability to alter the source and/or target
Declaration
void ProcessSegmentPairs(string processingName, Action<ISegmentPair, CancelEventArgs> process)
Parameters
Type | Name | Description |
---|---|---|
System.String | processingName | A custom provided name for the processing operation used for the undo history. |
System.Action<ISegmentPair, System.ComponentModel.CancelEventArgs> | process | Processing delegate responsable for analyzing the segment pairs. |
Remarks
Even if the source is configured to be in the editable mode this will not be functional if the document does not allow it.
SelectedSegmentsContainRevisions()
Checks if the selected segments on Target contains Revisions or TQA
Declaration
bool SelectedSegmentsContainRevisions()
Returns
Type | Description |
---|---|
System.Boolean |
SetActiveSegmentPair(ProjectFile, String, Boolean)
Sets the active segment pair to the segment pair with the given number and sets focus on that segment if specified.
Declaration
bool SetActiveSegmentPair(ProjectFile projectFile, string segmentNumber, bool setFocusOnSegment = false)
Parameters
Type | Name | Description |
---|---|---|
ProjectFile | projectFile | For normal document it is opened from one file and for virtual document it is opened from multiple files. When the document is virtual the projetFile indicates the refered file, which can be obtained from Files properpty of Document. For normal document, this parameter is ignored. |
System.String | segmentNumber | The segment number. |
System.Boolean | setFocusOnSegment | Set this to true if focus should be set to the segment |
Returns
Type | Description |
---|---|
System.Boolean | True if the segment pair was activated successfully. This may be false if no such segment exists or if the segment is currently filtered out from view.> |
SetActiveSegmentPair(String, String, Boolean)
Sets the active segment pair to the segment pair with the given paragraphId and segmentNumber.
Declaration
bool SetActiveSegmentPair(string paragraphId, string segmentNumber, bool setFocusOnSegment = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | paragraphId | |
System.String | segmentNumber | |
System.Boolean | setFocusOnSegment | Set this to true if focus should be set to the segment |
Returns
Type | Description |
---|---|
System.Boolean |
TryTranslateActiveSegment()
Tries to initiate the translation process for the active segment.
Declaration
void TryTranslateActiveSegment()
Remarks
If the project does not have any Translation Provider set, the translation of the active segment will not work.
UpdateCommentOnSegment(ISegmentPair, IComment, String, Severity)
Update a comment text and severity on the target segment
Declaration
void UpdateCommentOnSegment(ISegmentPair segmentPair, IComment commentToUpdate, string text, Severity severity)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
IComment | commentToUpdate | Comment to be updated |
System.String | text | New coment text |
Severity | severity | New coment severity level |
UpdateParagraphUnitProperties(IParagraphUnitProperties)
Directly update the properties of a paragraph unit
Declaration
void UpdateParagraphUnitProperties(IParagraphUnitProperties paragraphUnitProperties)
Parameters
Type | Name | Description |
---|---|---|
IParagraphUnitProperties | paragraphUnitProperties | Updated properties for the paragraph unit |
UpdateSegmentPair(ISegmentPair)
Directly update a segment pair in the document
Declaration
void UpdateSegmentPair(ISegmentPair segmentPair)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Updated segment pair |
UpdateSegmentPairProperties(ISegmentPair, ISegmentPairProperties)
Directly update the properties of a segment pair, without processing the whole segment pair
Declaration
void UpdateSegmentPairProperties(ISegmentPair segmentPair, ISegmentPairProperties segmentPairProperties)
Parameters
Type | Name | Description |
---|---|---|
ISegmentPair | segmentPair | Segment |
ISegmentPairProperties | segmentPairProperties | Updated properties for the segment pair |
Events
ActiveFileChanged
Triggered when the active file is changed.
Declaration
event EventHandler ActiveFileChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
ActiveFilePropertiesChanged
Triggered when the properties of the active file are changed
Declaration
event EventHandler ActiveFilePropertiesChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
ActiveSegmentChanged
Triggered when the active segment is changed.
Declaration
event EventHandler ActiveSegmentChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
ActiveSegmentContentIsReady
The event is triggered when the content for the active segment is ready and it can be modified by a third party application.
Declaration
event EventHandler ActiveSegmentContentIsReady
Event Type
Type | Description |
---|---|
System.EventHandler |
ContentChanged
Triggered when document content is changed.
Declaration
event EventHandler<DocumentContentEventArgs> ContentChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentContentEventArgs> |
DocumentFilterChanged
Triggered when the document filter has changed.
Declaration
event EventHandler<DocumentFilterEventArgs> DocumentFilterChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentFilterEventArgs> |
SegmentsConfirmationLevelChanged
The event is triggered when a ConfirmationLevel is changed for a Segment.
Declaration
event EventHandler SegmentsConfirmationLevelChanged
Event Type
Type | Description |
---|---|
System.EventHandler |
SegmentsTranslationOriginChanged
The event is triggered when a TranslationOrigin is changed for a Segment.
Declaration
event EventHandler SegmentsTranslationOriginChanged
Event Type
Type | Description |
---|---|
System.EventHandler |