Provides data for the SmartPasteRequest event. Contains the clipboard content, fields, a cancellation token, and methods to signal the result of the AI request.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class SmartPasteButtonRequestEventArgs : EventArgs
Inheritance: objectEventArgsSmartPasteButtonRequestEventArgs
Inherited Members
Properties
Gets the cancellation token that is triggered when the user cancels the smart paste operation. Pass this token to async operations (e.g., HTTP requests) to support cooperative cancellation.
public CancellationToken CancellationToken { get; }
The content to be processed by the Smart Paste Button. When the event is triggered, this property contains the clipboard content of the user.
public string Content { get; }
Security — Prompt Injection: This value is raw, untrusted clipboard text. Do not embed it directly into an AI prompt without sanitization or clear contextual separation (e.g., wrapping it in delimiters and instructing the model to treat it as data only). Failure to do so may allow maliciously crafted clipboard content to override the AI's instructions.
Array of fields that should be populated with the AI response using the content provided.
public SmartPasteButtonField[] Fields { get; }
Methods
Call this method to cancel the smart paste operation.
public void Cancel()
Call this method to signal that an error occurred during the AI request.
public void SetError(Exception exception = null)
The exception that occurred, or null for a generic error.
Call this method to provide the AI response as a dictionary of field values. The button will convert the values and populate the provider fields.