Class AbstractAutoSuggestProvider
Defines the base class for the autosuggest provider, which are components with visual representation that provide to Trados Studio users suggestions while they are editing the target documents (the translation in a "target" language of a document).
Implements
Inherited Members
Namespace: SdlSdl.TranslationStudioAutomationIntegrationApiAutoSuggest
Assembly: Sdl.TranslationStudioAutomation.IntegrationApi.dll
Syntax
public abstract class AbstractAutoSuggestProvider : IDisposable
Constructors
AbstractAutoSuggestProvider()
Declaration
protected AbstractAutoSuggestProvider()
Properties
ActiveDocument
Get the active document property.
Declaration
protected IStudioDocument ActiveDocument { get; }
Property Value
Type | Description |
---|---|
IStudioDocument |
ActiveSegmentPair
Get the active segment pair of the active document.
Declaration
protected ISegmentPair ActiveSegmentPair { get; }
Property Value
Type | Description |
---|---|
ISegmentPair |
EditorController
Get the editor controller.
Declaration
protected EditorController EditorController { get; }
Property Value
Type | Description |
---|---|
EditorController |
Icon
Gets or sets the icon for this auto suggestion provider . Can be null.
Declaration
public Icon Icon { get; set; }
Property Value
Type | Description |
---|---|
Icon |
Settings
Get or set the AutoSuggest provider settings.
Declaration
public AutoSuggestSettings Settings { get; set; }
Property Value
Type | Description |
---|---|
AutoSuggestSettings |
Methods
Dispose()
Executed to release the resources.
Declaration
public void Dispose()
Dispose(bool)
Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Determines the caller that is invoking the dispose. |
GetSuggestions(AbstractEditingContext)
Executed when the suggestions are requested.
Declaration
protected abstract IEnumerable<AbstractAutoSuggestResult> GetSuggestions(AbstractEditingContext context)
Parameters
Type | Name | Description |
---|---|---|
AbstractEditingContext | context | the context of the request. |
Returns
Type | Description |
---|---|
IEnumerableAbstractAutoSuggestResult | An enumeration containg the suggested results. |
Remarks
This method is not invoked if the Trados Studio user decided to disable the provider (Settings.Enabled = false).
OnActiveDocumentChanged()
Override it to process when the active document is changed. This method is called whenever the Trados Studio user changes the current document by opening, closing or switching documents. Note: The concreate implementation can be used to prepare the AutoSuggest dictionary, prepare document specific initializations, etc.
Declaration
protected virtual void OnActiveDocumentChanged()
Remarks
This method will not be invoked if the Trados Studio user decided to disable the provider (Settings.Enabled = false).
OnActiveSegmentChanged()
Override it to process when the active segment is changed. This method is called whenever in the editor the current active segment has been changed. Note: The concreate implementation can be used to prepare the AutoSuggest cadidates.
Declaration
protected virtual void OnActiveSegmentChanged()
Remarks
This method will not be invoked if the Trados Studio user decided to disable the provider (Settings.Enabled = false).
OnSettingsChanged()
Override to implement custom logic when the provider settings are changed.
Declaration
protected virtual void OnSettingsChanged()
Remarks
This method informs the developer of any setting changes and can be used to establish if the provider is enable or disabled.�