SmartPasteBase.ExcludedItems Property
Specifies a collection of items to be excluded from Smart Paste processing.
Namespace: DevExpress.AIIntegration.Blazor
Assembly: DevExpress.AIIntegration.Blazor.Common.v26.1.dll
Declaration
[Parameter]
public List<string> ExcludedItems { get; set; }
Property Value
| Type | Description |
|---|---|
| List<String> | A list of items to be excluded from Smart Paste processing. |
Remarks
The following code snippet adds the Smart Paste extension to a Form Layout component and excludes Statement Date and Note fields from Smart Paste processing:
@using DevExpress.AIIntegration.Blazor
@using DevExpress.AIIntegration.Blazor.Layout
@using DevExpress.AIIntegration.Extensions
<DxMemo @bind-Text="SampleText"
Rows="14"
ResizeMode="MemoResizeMode.Auto" />
<DxFormLayout @ref="FormLayout"
Data="@model"
CssClass="w-100 mb-2">
<Extensions>
<FormLayoutSmartPaste ItemDescriptions="@fieldDescriptions"
PromptAugmentation="@PromptAugmentation"
ExcludedItems="@ExcludedItems" />
</Extensions>
<ChildContent>
<DxFormLayoutItem Caption="Full Name" ColSpanMd="12"
Field="@nameof(BillingFormModel.FullName)">
<DxTextBox @bind-Text="@model.FullName"
NullText="Full Name" />
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Amount Due" ColSpanMd="12"
Field="@nameof(BillingFormModel.AmountDue)">
<DxMaskedInput @bind-Value="@model.AmountDue"
Mask="@NumericMask.Currency"
NullText="$0.00" />
</DxFormLayoutItem>
<DxFormLayoutItem Caption="Statement Date" ColSpanMd="12"
Field="@nameof(BillingFormModel.StatementDate)">
<DxDateEdit @bind-Date="@model.StatementDate"
NullText="MM/DD/YYYY" />
</DxFormLayoutItem>
@*...*@
</ChildContent>
</DxFormLayout>
<DxButton Text="Smart Paste"
IconCssClass="icon-ai-sparkle"
RenderStyle="ButtonRenderStyle.Primary"
Click="OnSmartPaste" />
<DxButton Text="Reset"
RenderStyle="ButtonRenderStyle.Secondary"
Click="@OnResetClick" />
@code {
DxFormLayout FormLayout { get; set; }
BillingFormModel model = new();
readonly Dictionary<string, string> fieldDescriptions = new() {
{ nameof(BillingFormModel.PhoneNumber), "US phone number. Return exactly 10 digits without any formatting characters."}
};
const string PromptAugmentation =
"Always override the current field value with the extracted one.";
List<string> ExcludedItems = new List<string>() {
nameof(BillingFormModel.StatementDate),
nameof(BillingFormModel.Note)
};
string SampleText { get; set; } =
"Hi there,\n" +
" \n" +
"Following up on billing for April. The balance should be twelve hundred " +
"— it was adjusted after our last conversation.\n" +
"I also moved recently. My new billing address is:\n" +
"123 Market Street, San Francisco, CA 94103\n" +
"You can keep using my email: john.smith@dx-email.com.\n" +
"For phone, please use my mobile number going forward: 415-555-0199 " +
"(not the office line).\n" +
"The statement date should be mid-April.\n" +
"Let me know if you need anything else.\n" +
" \n" +
"Best regards,\n" +
"John Smith";
async Task OnSmartPaste() {
model.Reset();
await FormLayout.SmartPasteAsync(SampleText);
}
void OnResetClick() {
model.Reset();
}
}
See Also