Table of Contents

Interface ISillDragAndDropActivator

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 drag-and-drop action into WindowSill.

public interface ISillDragAndDropActivator : ISillActivator
Extension Methods

Remarks

Each ISillDragAndDropActivator 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 DragAndDropActivatorTypeNames property to indicate that this sill should be activated when GetShouldBeActivatedAsync(DataPackageView, CancellationToken) returns true. The base name of the activation type is used to determine dependency on other activation types. For example, there may be an activator designed to get activated when an image is detected. Then there could be another activator that has dependency on the image activator and detects when the detected image has a specific size. This allows to create a chain of activators that activates sills based on more specific conditions.

<pre><code class="lang-csharp">[(typeof())]
[("Full HD Image Activator", baseName: "Image Activator"/>)]
internal sealed class MySillActivator: 
{
}</code></pre>

Methods

GetShouldBeActivatedAsync(DataPackageView, CancellationToken)

Determines whether the specified data should trigger activation based on the provided conditions.

ValueTask<bool> GetShouldBeActivatedAsync(DataPackageView dataPackageView, CancellationToken cancellationToken)

Parameters

dataPackageView DataPackageView

The data package view containing the drag-and-drop data to evaluate.

cancellationToken CancellationToken

A 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.