Class EditorController
Implement the controller for the editor view and provide access to common editor operations.
Inheritance
Inherited Members
Namespace: Sdl.TranslationStudioAutomation.IntegrationApi
Assembly: Sdl.TranslationStudioAutomation.IntegrationApi.dll
Syntax
[BindController("EditorView")]
public class EditorController : AbstractBindedController, IDisposable, IBindedController
Constructors
EditorController()
Declaration
public EditorController()
Properties
ActiveDocument
Get the active document.
Declaration
public IStudioDocument ActiveDocument { get; }
Property Value
Type | Description |
---|---|
IStudioDocument |
ConcordanceSearchController
Gets the controller responsible for interacting with Concordance Search
Declaration
public IConcordanceSearchController ConcordanceSearchController { get; }
Property Value
Type | Description |
---|---|
IConcordanceSearchController |
TranslationResultsController
Gets the controller responsible for interacting with Concordance Search
Declaration
public ITranslationResultsController TranslationResultsController { get; }
Property Value
Type | Description |
---|---|
ITranslationResultsController |
Methods
Activate(IStudioDocument)
Activates the specified document
Declaration
public void Activate(IStudioDocument document)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | Document to be activated. |
Close(IStudioDocument)
Performs the closing of the document.
Declaration
public void Close(IStudioDocument document)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | The document for which the operation is executed. |
GetDocuments()
Gets all the opened documents.
Declaration
public IEnumerable<IStudioDocument> GetDocuments()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IStudioDocument> | Returns an enumerable document collection of all the opened documents. |
Initialize(IViewContext)
Implements the editor controller initialization
Declaration
protected override void Initialize(IViewContext context)
Parameters
Type | Name | Description |
---|---|---|
IViewContext | context | The context of the editor controller when initialized |
Overrides
Open(ProjectFile, EditingMode)
Open a document from a project file in the specified editing mode.
Declaration
public IStudioDocument Open(ProjectFile projectFile, EditingMode mode)
Parameters
Type | Name | Description |
---|---|---|
ProjectFile | projectFile | Project file to open. |
EditingMode | mode | The editing mode in which the document will be loaded. |
Returns
Type | Description |
---|---|
IStudioDocument | The opened document. |
Open(IEnumerable<ProjectFile>, EditingMode)
Open multiple project files.
Declaration
public IStudioDocument Open(IEnumerable<ProjectFile> projectFiles, EditingMode mode)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<ProjectFile> | projectFiles | Project files to be opened. |
EditingMode | mode | The editing mode in which the document will be loaded. |
Returns
Type | Description |
---|---|
IStudioDocument | The opened document. |
Open(String)
Open a document from a physical file path.
Declaration
public IStudioDocument Open(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | Phath to the phisical file which should be opened. |
Returns
Type | Description |
---|---|
IStudioDocument | The opened document. |
Save(IStudioDocument)
Perform the saving of the document.
Declaration
public void Save(IStudioDocument document)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | The document for which the operation is executed. |
SaveAs(IStudioDocument, Boolean)
Show the Save As dialog.
Declaration
public void SaveAs(IStudioDocument document, bool saveProjectSettings = false)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | The document for which the Save As operation is executed. |
System.Boolean | saveProjectSettings | True for saving the project settings |
SaveAs(IStudioDocument, IEnumerable<String>, Boolean)
Save the document to the specified absolute path
Declaration
public void SaveAs(IStudioDocument document, IEnumerable<string> filePaths, bool saveProjectSettings = false)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | The document for which the Save As operation is executed. |
System.Collections.Generic.IEnumerable<System.String> | filePaths | The absolute paths to save the content to. |
System.Boolean | saveProjectSettings | True for saving the project settings |
SaveSourceAs(IStudioDocument)
Show the Save Source As dialog.
Declaration
public void SaveSourceAs(IStudioDocument document)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | The document for which the Save Source As operation is executed. |
SaveTargetAs(IStudioDocument)
Show the Save Target As dialog.
Declaration
public void SaveTargetAs(IStudioDocument document)
Parameters
Type | Name | Description |
---|---|---|
IStudioDocument | document | The document for which the Save Target As operation is executed. |
Events
ActiveDocumentChanged
Triggered when the active document has been changed.
Declaration
public event EventHandler<DocumentEventArgs> ActiveDocumentChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentEventArgs> |
Closed
Triggered after a document is closed.
Declaration
public event EventHandler<DocumentEventArgs> Closed
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentEventArgs> |
Closing
Triggered before a document is closed.
Declaration
public event EventHandler<CancelDocumentEventArgs> Closing
Event Type
Type | Description |
---|---|
System.EventHandler<CancelDocumentEventArgs> |
Opened
Triggered after a document is opened.
Declaration
public event EventHandler<DocumentEventArgs> Opened
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentEventArgs> |
Opening
Triggered before a document is opened.
Declaration
public event EventHandler<CancelDocumentEventArgs> Opening
Event Type
Type | Description |
---|---|
System.EventHandler<CancelDocumentEventArgs> |
Saved
Triggered after a document is saved.
Declaration
public event EventHandler<DocumentEventArgs> Saved
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentEventArgs> |
SaveFailed
Triggered if the save is failing
Declaration
public event EventHandler<DocumentErrorEventArgs> SaveFailed
Event Type
Type | Description |
---|---|
System.EventHandler<DocumentErrorEventArgs> |
Saving
Triggered before a document is saved.
Declaration
public event EventHandler<CancelDocumentEventArgs> Saving
Event Type
Type | Description |
---|---|
System.EventHandler<CancelDocumentEventArgs> |