Back to Devexpress

DocumentTranslateBehavior Class

windowsforms-devexpress-dot-aiintegration-dot-winforms-91c4f96d.md

latest2.9 KB
Original Source

DocumentTranslateBehavior Class

Converts the text contained in a document from one language to another while maintaining the original meaning and context.

Namespace : DevExpress.AIIntegration.WinForms

Assembly : DevExpress.AIIntegration.WinForms.v25.2.dll

NuGet Package : DevExpress.AIIntegration.WinForms

Declaration

csharp
public class DocumentTranslateBehavior :
    DocumentBehavior<DocumentTranslateBehaviorSource>
vb
Public Class DocumentTranslateBehavior
    Inherits DocumentBehavior(Of DocumentTranslateBehaviorSource)

Remarks

Use the Languages parameter to specify target languages for text translation.

The following code snippet registers a DocumentTranslateBehavior and assigns it to the Document Viewer control:

csharp
using DevExpress.AIIntegration;
using DevExpress.AIIntegration.WinForms;
// ...
public partial class Form1 : Form {
    public Form1() {
        InitializeComponent();
            behaviorManager1.Attach<DocumentTranslateBehavior>(documentViewer1, behavior => {
                behavior.Properties.Languages = new LanguageInfo[] {
                    new LanguageInfo("de-DE"),
                    new LanguageInfo("es-ES")
                };
            });
    }
}
vb
Imports DevExpress.AIIntegration
Imports DevExpress.AIIntegration.WinForms
' ...
Partial Public Class Form1
    Inherits Form

    Public Sub New()
        InitializeComponent()
            behaviorManager1.Attach(Of DocumentTranslateBehavior)(documentViewer1, Sub(behavior)
                behavior.Properties.Languages = New LanguageInfo() {
                    New LanguageInfo("de-DE"),
                    New LanguageInfo("es-ES")
                }
            End Sub)
    End Sub
End Class

Inheritance

Object DevExpress.Utils.MVVM.BehaviorBase DevExpress.Utils.Behaviors.Behavior DevExpress.Utils.Behaviors.Behavior<DevExpress.AIIntegration.WinForms.DocumentTranslateBehaviorSource> DevExpress.AIIntegration.WinForms.DocumentBehaviorBase<DevExpress.AIIntegration.WinForms.DocumentTranslateBehaviorSource> DevExpress.AIIntegration.WinForms.DocumentBehavior<DevExpress.AIIntegration.WinForms.DocumentTranslateBehaviorSource> DocumentTranslateBehavior

See Also

DocumentTranslateBehavior Members

DevExpress.AIIntegration.WinForms Namespace