Interface ISillActivatedByTextSelection
- Namespace
- WindowSill.API
- Assembly
- WindowSill.API.dll
Represents the declaration of a sill that will be activated based on text being selected anywhere in the operating system.
public interface ISillActivatedByTextSelection : ISill
- Inherited Members
- Extension Methods
Remarks
Use this interface to create a sill that reacts to text selection in the foreground window, such as an AI-powered text assistant or JSON formatter.
<pre><code class="lang-csharp">[(typeof())]
[("My Sill")]
[()] // Optional. Default is .
[(Before = "OtherSill", After = "AnotherSill")] // Optional. Use to tied break ordering of sills when conflicting properties are set.
internal sealed class MySill:
{
}</code></pre>
Properties
TextSelectionActivatorTypeNames
Gets a list of ISillTextSelectionActivator activator names that determine when this sill will be activated based on text selection.
string[] TextSelectionActivatorTypeNames { get; }
Property Value
- string[]
Remarks
You can use existing activator names defined in PredefinedActivationTypeNames or define your own custom activator by implementing ISillTextSelectionActivator.
Methods
OnActivatedAsync(string, WindowTextSelection)
Invoked when the sill is activated based on text selection in the foreground window.
ValueTask OnActivatedAsync(string textSelectionActivatorTypeName, WindowTextSelection currentSelection)
Parameters
textSelectionActivatorTypeNamestringThe name of the activator type that triggered the activation. This can be used to understand whether a plain text or JSON activated this sill.
currentSelectionWindowTextSelectionIndicates the selected text in the foreground window, along with information about the associated app.
Returns
Remarks
This method is not awaited for completion.