Docsv3.31.0
Back to API Reference
Class

SearchWebCommand

Inherits:TextCommand

Opens the address its search URL builds from the selected text in the default browser — a web search by default; a dictionary, a translator or a map work the same way under their own titles. Applies while the selection may be copied; a selection longer than 1000 characters goes in as its first 1000.

[ctor]public SearchWebCommand()

Creates a command that searches the web with Google.

[ctor]public SearchWebCommand(string title, string searchUrl)

Creates a command titled title that opens searchUrl, whose {0} stands for the selected text.

public override bool IsApplicable(in TextCommandContext context)

Whether the command applies to the field's current state. A menu hides or disables a command that does not apply, and a command runs only while it applies.

public override void Execute(in TextCommandContext context)

Runs the command against the field's current state, to which it applies (IsApplicable).

public override bool Matches(TextCommand command)

Whether command is this command, as a menu item bound to this command matches the field's (ContextMenuItem.Command): by default, a command of this type or one derived from it. The title plays no part; a command whose settings decide its effect compares them too, as a style toggle compares its style.