windowsforms-devexpress-dot-aiintegration-dot-winforms-dot-smartsearchbehavior.md
Gets Smart Search behavior settings.
Namespace : DevExpress.AIIntegration.WinForms
Assembly : DevExpress.AIIntegration.WinForms.v25.2.dll
NuGet Package : DevExpress.AIIntegration.WinForms
public SmartSearchBehaviorProperties Properties { get; }
Public ReadOnly Property Properties As SmartSearchBehaviorProperties
| Type | Description |
|---|---|
| SmartSearchBehaviorProperties |
Smart Search behavior settings.
|
Once you attach the SmartSearchBehavior to a control, you should describe items so that Smart Search can find appropriate items. In the context of Smart Search, an item refers to a BarItem when working with a RibbonControl, or an AccordionControlElement when working with an AccordionControl.
Note
Item descriptions are optional if an item’s text or caption is specified (for example, a bar item’s Caption property or accordion UI element’s Text property is set to a non-empty string). Although Smart Search attempts to find items based on their text/caption, we recommend that you also describe items for improved accuracy.
Use the SmartSearchBehavior.Properties.ItemDescriptions collection property to add descriptions (AIItemDescription) for certain items. Each AIItemDescription object in the collection has two properties:
AIItemDescription.Item: An item (BarItem or AccordionControlElement).AIItemDescription.Description: A string that describes the item.If you want to exclude a specific item from Smart Search, you can add this item to the SmartSearchBehavior.Properties.ExcludedItems collection. This allows you to exclude Ribbon commands (items) or Accordion UI elements from being affected by Smart Search.
using DevExpress.AIIntegration.WinForms;
using DevExpress.XtraBars.Ribbon;
public Form1() {
InitializeComponent();
// Displays a search box in the Ribbon control's caption.
ribbon.OptionsSearchMenu.SearchItemPosition = SearchItemPosition.Caption;
behaviorManager1.Attach<SmartSearchBehavior>(ribbon, behavior => {
behavior.Properties.ItemDescriptions.AddRange(new AIItemDescription[]{
new AIItemDescription(itemEnableSystemProtection, "Activates software protection against unauthorized access."),
new AIItemDescription(itemLogin, "Displays a sign-in or login form."),
new AIItemDescription(itemSettings, "Displays settings and options related to security and protection."),
new AIItemDescription(itemRBAC, "Manages user access permissions and role-based access control (RBAC)."),
new AIItemDescription(itemBackup, "Backs up (creates a copy of) sensitive data (information)."),
new AIItemDescription(itemRestore, "Restores data from a backup database."),
});
});
}
Imports DevExpress.AIIntegration.WinForms
Imports DevExpress.XtraBars.Ribbon
Public Sub New()
InitializeComponent()
' Displays a search box in the Ribbon control's caption.
ribbon.OptionsSearchMenu.SearchItemPosition = SearchItemPosition.Caption
behaviorManager1.Attach(Of SmartSearchBehavior)(ribbon, Sub(behavior)
behavior.Properties.ItemDescriptions.AddRange(New AIItemDescription(){
New AIItemDescription(itemEnableSystemProtection, "Activates software protection against unauthorized access."),
New AIItemDescription(itemLogin, "Displays a sign-in or login form."),
New AIItemDescription(itemSettings, "Displays settings and options related to security and protection."),
New AIItemDescription(itemRBAC, "Manages user access permissions and role-based access control (RBAC)."),
New AIItemDescription(itemBackup, "Backs up (creates a copy of) sensitive data (information)."),
New AIItemDescription(itemRestore, "Restores data from a backup database.")
})
End Sub)
End Sub
Tip
Read the following help topic for additional information: AI-powered Smart Search.
See Also