Interface IStudioDocument
Interface for the document implementation
Namespace: SdlSdl.TranslationStudioAutomationIntegrationApi
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 |
---|---|
IEnumerableProjectFile |
FilteredSegmentPairs
Get the filtered document segment pairs in a readonly mode
Declaration
IEnumerable<ISegmentPair> FilteredSegmentPairs { get; }
Property Value
Type | Description |
---|---|
IEnumerableISegmentPair |
FilteredSegmentPairsCount
The filtered document segment pairs count
Declaration
int FilteredSegmentPairsCount { get; }
Property Value
Type | Description |
---|---|
int |
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 |
---|---|
bool |
IsTranslationProviderAvailable
Get a boolean value that indicate if a Translation Provider is available.
Declaration
bool IsTranslationProviderAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
IEnumerableISegmentPair |
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 |
---|---|
int |
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 |
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 |
---|---|---|
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 |
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, bool, bool)
Declaration
bool FindTextInSegment(string segmentNumber, string text, bool highlightText, bool searchInSource)
Parameters
Type | Name | Description |
---|---|---|
string | segmentNumber | |
string | text | |
bool | highlightText | |
bool | searchInSource |
Returns
Type | Description |
---|---|
bool |
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 |
---|---|
IEnumerableIComment | 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(int)
Get the segment pair from the row number
Declaration
ISegmentPair GetSegmentPair(int rowNumber)
Parameters
Type | Name | Description |
---|---|---|
int | 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 |
---|---|---|
string | paragraphUnitId | The paragraph unit id |
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 |
---|---|
IEnumerableISegmentPair | A list of segment pairs from the provided paragraph |
GetSelectedSegmentPairs()
Obtain all selected segment pairs
Declaration
IEnumerable<ISegmentPair> GetSelectedSegmentPairs()
Returns
Type | Description |
---|---|
IEnumerableISegmentPair | 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 |
string | processingName | A custom provided name for the processing operation used for the undo history. |
ActionISegmentPairCancelEventArgs | 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 |
---|---|---|
string | processingName | A custom provided name for the processing operation used for the undo history. |
ActionISegmentPairCancelEventArgs | 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 |
---|---|
bool |
SetActiveSegmentPair(ProjectFile, string, bool)
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. |
string | segmentNumber | The segment number. |
bool | setFocusOnSegment | Set this to true if focus should be set to the segment |
Returns
Type | Description |
---|---|
bool | 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, bool)
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 |
---|---|---|
string | paragraphId | |
string | segmentNumber | |
bool | setFocusOnSegment | Set this to true if focus should be set to the segment |
Returns
Type | Description |
---|---|
bool |
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 |
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 |
---|---|
EventHandler |
ActiveFilePropertiesChanged
Triggered when the properties of the active file are changed
Declaration
event EventHandler ActiveFilePropertiesChanged
Event Type
Type | Description |
---|---|
EventHandler |
ActiveSegmentChanged
Triggered when the active segment is changed.
Declaration
event EventHandler ActiveSegmentChanged
Event Type
Type | Description |
---|---|
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 |
---|---|
EventHandler |
ContentChanged
Triggered when document content is changed.
Declaration
event EventHandler<DocumentContentEventArgs> ContentChanged
Event Type
Type | Description |
---|---|
EventHandlerDocumentContentEventArgs |
DocumentFilterChanged
Triggered when the document filter has changed.
Declaration
event EventHandler<DocumentFilterEventArgs> DocumentFilterChanged
Event Type
Type | Description |
---|---|
EventHandlerDocumentFilterEventArgs |
SegmentTranslated
Triggered after a segment has been translated.
Declaration
event EventHandler SegmentTranslated
Event Type
Type | Description |
---|---|
EventHandler |
SegmentsConfirmationLevelChanged
The event is triggered when a ConfirmationLevel is changed for a Segment.
Declaration
event EventHandler SegmentsConfirmationLevelChanged
Event Type
Type | Description |
---|---|
EventHandler |
SegmentsTranslationOriginChanged
The event is triggered when a TranslationOrigin is changed for a Segment.
Declaration
event EventHandler SegmentsTranslationOriginChanged
Event Type
Type | Description |
---|---|
EventHandler |