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.

Parameter
Type
Description

control

The control to check.

Returns: Boolean. True if auto-correction is enabled; otherwise, false.

Throws:

GetEnableSuggestions(control)

Determines whether the suggestions feature is enabled for the specified control.

Parameter
Type
Description

control

The control to check.

Returns: Boolean. True if suggestions are enabled; otherwise, false.

Throws:

GetEnableTranslation(control)

Determines whether the translation feature is enabled for the specified control.

Parameter
Type
Description

control

The control to check.

Returns: Boolean. True if translation is enabled; otherwise, false.

Throws:

GetTranslateFromLanguage(control)

Gets the source language for the translation feature associated with the specified control.

Parameter
Type
Description

control

The control from which to retrieve the source language.

Returns: String. The source language as a string.

Throws:

GetTranslateToLanguage(control)

Gets the target language for the translation feature associated with the specified control.

Parameter
Type
Description

control

The control from which to retrieve the target language.

Returns: String. The target language as a string.

Throws:

GetUserPhrases(control)

Gets the user-provided phrases associated with the specified control.

Parameter
Type
Description

control

The control from which to retrieve the user phrases.

Returns: String[]. An array of user phrases.

Throws:

GetUserRole(control)

Gets the user role associated with the specified control.

Parameter
Type
Description

control

The control from which to retrieve the user role.

Returns: String. The user role as a string.

Throws:

OnControlCreated(control)

Parameter
Type
Description

control

OnControlDisposed(control)

Parameter
Type
Description

control

RunAsyncCore(control)

Parameter
Type
Description

control

Returns: Task<Message>.

SetEnableAutoCorrection(control, value)

Parameter
Type
Description

control

value

SetEnableSuggestions(control, value)

Parameter
Type
Description

control

value

SetEnableTranslation(control, value)

Parameter
Type
Description

control

value

SetTranslateFromLanguage(control, value)

Sets the source language for the translation feature associated with the specified control.

Parameter
Type
Description

control

The control to associate with the source language.

value

The source language as a string.

Throws:

SetTranslateToLanguage(control, value)

Sets the target language for the translation feature associated with the specified control.

Parameter
Type
Description

control

The control to associate with the target language.

value

The target language as a string.

Throws:

SetUserPhrases(control, phrases)

Parameter
Type
Description

control

phrases

SetUserRole(control, value)

Parameter
Type
Description

control

value

Implements

Name
Description

Represents a provider that supplies tools.

Last updated