Skip to main content
All docs
V26.1
  • DocumentTranslateInlineBehavior Class

    SECURITY-RELATED CONSIDERATIONS

    This API includes automatic prompt-injection protection for text and document-based AI-powered extensions. The system appends security instructions to each AI request to ensure that external or user-provided content is treated as untrusted data.

    Prompt Injection Protection in AI Extensions

    Converts the text contained in a document from one language to another on the document preview.

    Namespace: DevExpress.AIIntegration.WinForms

    Assembly: DevExpress.AIIntegration.WinForms.v26.1.dll

    Declaration

    public class DocumentTranslateInlineBehavior :
        DocumentBehaviorBase<DocumentTranslateInlineBehaviorSource>

    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:

    using DevExpress.AIIntegration;
    using DevExpress.AIIntegration.WinForms;
    // ...
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
                behaviorManager1.Attach<DocumentTranslateInlineBehavior>(documentViewer1, behavior => {
                    behavior.Properties.Languages = new LanguageInfo[] {
                        new LanguageInfo("de-DE")
                    };
                });
        }
    }
    

    Review the following help topic for more information on how to use this functionality in the WinForms Document Viewer: Translate Reports Inline in the WinForms Document Viewer

    Inheritance

    Object
    DevExpress.Utils.MVVM.BehaviorBase
    DevExpress.Utils.Behaviors.Behavior
    DevExpress.Utils.Behaviors.Behavior<DevExpress.AIIntegration.WinForms.DocumentTranslateInlineBehaviorSource>
    DevExpress.AIIntegration.WinForms.DocumentBehaviorBase<DevExpress.AIIntegration.WinForms.DocumentTranslateInlineBehaviorSource>
    DocumentTranslateInlineBehavior
    See Also