SmartTextBoxAdapter
Wisej.AI.Adapters.SmartTextBoxAdapter
Namespace: Wisej.AI.Adapters
Assembly: Wisej.AI (3.5.0.0)
Enhances a TextBox control with several AI features, including suggestions, translation, and auto-correction.
public class SmartTextBoxAdapter : SmartAdapter, IExtenderProvider
This class extends the functionality of a standard TextBox by providing AI-driven features such as text suggestions, automatic translation between specified languages, and auto-correction of text input. It uses SmartPrompt sessions to interact with AI services.
Constructors
SmartTextBoxAdapter()

Initializes a new instanced of SmartTextBoxAdapter.
Properties
AcceptIconSource

String: Gets or sets the source of the icon displayed when a suggestion is accepted. (Default: null
)
ProcessingIconSource

String: Gets or sets the source of the icon displayed during processing. (Default: "resource.wx/Wisej.AI/Icons/processing.svg"
)
SuggestionDelay

Int32: Gets or sets the delay in milliseconds before suggestions are shown. (Default: 250
)
SuggestionStyle

String: Gets or sets the CSS style applied to suggestions. (Default: "opacity:0.4"
)
Methods
GetEnableAutoCorrection(control)

Determines whether the auto-correction feature is enabled for the specified control.
Returns: Boolean. True if auto-correction is enabled; otherwise, false.
Throws:
ArgumentNullException Thrown when the control is null.
GetEnableSuggestions(control)

Determines whether the suggestions feature is enabled for the specified control.
Returns: Boolean. True if suggestions are enabled; otherwise, false.
Throws:
ArgumentNullException Thrown when the control is null.
GetEnableTranslation(control)

Determines whether the translation feature is enabled for the specified control.
Returns: Boolean. True if translation is enabled; otherwise, false.
Throws:
ArgumentNullException Thrown when the control is null.
GetTranslateFromLanguage(control)

Gets the source language for the translation feature associated with the specified control.
Returns: String. The source language as a string.
Throws:
ArgumentNullException Thrown when the control is null.
GetTranslateToLanguage(control)

Gets the target language for the translation feature associated with the specified control.
Returns: String. The target language as a string.
Throws:
ArgumentNullException Thrown when the control is null.
GetUserPhrases(control)

Gets the user-provided phrases associated with the specified control.
Returns: String[]. An array of user phrases.
Throws:
ArgumentNullException Thrown when the control is null.
GetUserRole(control)

Gets the user role associated with the specified control.
Returns: String. The user role as a string.
Throws:
ArgumentNullException Thrown when the control is null.
OnControlCreated(control)

OnControlDisposed(control)

RunAsyncCore(control)

Returns: Task<Message>.
SetEnableAutoCorrection(control, value)

SetEnableSuggestions(control, value)

SetEnableTranslation(control, value)

SetTranslateFromLanguage(control, value)

Sets the source language for the translation feature associated with the specified control.
Throws:
ArgumentNullException Thrown when the control is null.
SetTranslateToLanguage(control, value)

Sets the target language for the translation feature associated with the specified control.
Throws:
ArgumentNullException Thrown when the control is null.
SetUserPhrases(control, phrases)

SetUserRole(control, value)

Implements
Represents a provider that supplies tools.
Last updated