Class EditorController
Implement the controller for the editor view and provide access to common editor operations.
Inheritance
Inherited Members
Namespace: SdlSdl.TranslationStudioAutomationIntegrationApi
Assembly: Sdl.TranslationStudioAutomation.IntegrationApi.dll
Syntax
[BindController("EditorView")]
public class EditorController : AbstractBindedController, IDisposable, IBindedController
Constructors
EditorController(IStudioWindow, ITranslatableDocumentFromPathOpener, IEditorService)
Declaration
public EditorController(IStudioWindow studioWindow, ITranslatableDocumentFromPathOpener translatableDocumentFromPathOpener, IEditorService editorService)
Parameters
Type | Name | Description |
---|---|---|
Sdl.Desktop.Platform.IStudioWindow | studioWindow | |
Sdl.TranslationStudio.Api.Editor.ITranslatableDocumentFromPathOpener | translatableDocumentFromPathOpener | |
Sdl.TranslationStudio.Api.Editor.IEditorService | editorService |
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 |
TermRecognitionResultsController
Gets the controller responsible for interacting with Term Recognition Results
Declaration
public ITermRecognitionResultsController TermRecognitionResultsController { get; }
Property Value
Type | Description |
---|---|
ITermRecognitionResultsController |
TranslationResultsController
Gets the controller responsible for interacting with Translation Results
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 |
---|---|
IEnumerableIStudioDocument | 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 |
---|---|---|
IEnumerableProjectFile | 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 |
---|---|---|
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, bool)
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. |
bool | saveProjectSettings | True for saving the project settings |
SaveAs(IStudioDocument, IEnumerable<string>, bool)
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. |
IEnumerablestring | filePaths | The absolute paths to save the content to. |
bool | 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 |
---|---|
EventHandlerDocumentEventArgs |
Closed
Triggered after a document is closed.
Declaration
public event EventHandler<DocumentEventArgs> Closed
Event Type
Type | Description |
---|---|
EventHandlerDocumentEventArgs |
Closing
Triggered before a document is closed.
Declaration
public event EventHandler<CancelDocumentEventArgs> Closing
Event Type
Type | Description |
---|---|
EventHandlerCancelDocumentEventArgs |
Opened
Triggered after a document is opened.
Declaration
public event EventHandler<DocumentEventArgs> Opened
Event Type
Type | Description |
---|---|
EventHandlerDocumentEventArgs |
Opening
Triggered before a document is opened.
Declaration
public event EventHandler<CancelDocumentEventArgs> Opening
Event Type
Type | Description |
---|---|
EventHandlerCancelDocumentEventArgs |
SaveFailed
Triggered if the save is failing
Declaration
public event EventHandler<DocumentErrorEventArgs> SaveFailed
Event Type
Type | Description |
---|---|
EventHandlerDocumentErrorEventArgs |
Saved
Triggered after a document is saved.
Declaration
public event EventHandler<DocumentEventArgs> Saved
Event Type
Type | Description |
---|---|
EventHandlerDocumentEventArgs |
Saving
Triggered before a document is saved.
Declaration
public event EventHandler<CancelDocumentEventArgs> Saving
Event Type
Type | Description |
---|---|
EventHandlerCancelDocumentEventArgs |