Interface ISillProcessActivator
- Namespace
- WindowSill.API
- Assembly
- WindowSill.API.dll
Represents the declaration of a sill activator that will be used to determine whether a sill should be activated based on which app has the focus on the operating system.
public interface ISillProcessActivator : ISillActivator
- Extension Methods
Remarks
Each ISillProcessActivator must have an ActivationTypeAttribute that defines its name and base activation type.
The name of the activator is used as a unique identifier for the activator. The name can be
assigned to a ProcessActivatorTypeNames property to indicate that this sill should be activated
when GetShouldBeActivatedAsync(string, Process, Version?, CancellationToken) returns true.
<pre><code class="lang-csharp">[(typeof())]
[("My app")]
internal sealed class MySillActivator:
{
}</code></pre>
Methods
GetShouldBeActivatedAsync(string, Process, Version?, CancellationToken)
Determines whether the specified process should trigger activation based on the provided conditions.
ValueTask<bool> GetShouldBeActivatedAsync(string applicationIdentifier, Process process, Version? version, CancellationToken cancellationToken)
Parameters
applicationIdentifierstringThe unique identifier of the application to evaluate.
processProcessThe process associated with the application.
versionVersionThe version of the application, or null if the version could not be detected.
cancellationTokenCancellationTokenA token to monitor for cancellation requests, which cancels after 500 milliseconds.
Returns
- ValueTask<bool>
A ValueTask<TResult> that represents the asynchronous operation. The result is true if activation should occur; otherwise, false.