New to Telerik UI for WinFormsStart a free 30-day trial

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:

C#
public class SmartPasteButtonRequestEventArgs : EventArgs

Inheritance: objectEventArgsSmartPasteButtonRequestEventArgs

Inherited Members EventArgs.Empty

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.

C#
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.

C#
public string Content { get; }
Remarks:

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.

C#
public SmartPasteButtonField[] Fields { get; }

Methods

Call this method to cancel the smart paste operation.

C#
public void Cancel()

Call this method to signal that an error occurred during the AI request.

C#
public void SetError(Exception exception = null)
Parameters:exceptionException

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.

C#
public void SetResponse(Dictionary<string, object> fieldValues)
Parameters:fieldValuesDictionary<string, object>

A dictionary mapping field identifiers to their extracted values.