TransferTargetDiscoveryOptions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The TransferTargetDiscoveryOptions class provides configuration options for discovering transfer targets. It allows developers to specify criteria for filtering and prioritizing transfer targets during the discovery process.
public ref class TransferTargetDiscoveryOptions sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.DataTransfer.ITransferTargetDiscoveryOptionsFactory, 1245184, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 1245184)]
/// [Windows.Foundation.Metadata.Experimental]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class TransferTargetDiscoveryOptions final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.DataTransfer.ITransferTargetDiscoveryOptionsFactory), 1245184, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 1245184)]
[Windows.Foundation.Metadata.Experimental]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class TransferTargetDiscoveryOptions
function TransferTargetDiscoveryOptions(dataPackage)
Public NotInheritable Class TransferTargetDiscoveryOptions
- Inheritance
- Attributes
Windows requirements
| Requirements | Description |
|---|---|
| Device family |
Windows 11, version 24H2 (introduced in 10.0.26100.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v19.0)
|
Examples
Example: Configuring TransferTargetWatcher with Discovery Options
var options = new TransferTargetDiscoveryOptions(dataPackageView)
{
AllowedTargetAppIds = new List<string> { "App1", "App2" },
MaxAppTargets = 5
};
var watcher = TransferTarget.CreateWatcher(options);
watcher.Start();
Remarks
This class is used to customize the behavior of the TransferTargetWatcher when discovering transfer targets. By setting properties on this class, developers can control which targets are discovered and how they are prioritized.
Key Properties:
AllowedTargetAppIds: Specifies a list of app IDs that are allowed as transfer targets.DataPackage: Specifies the data package used to filter relevant transfer targets.MaxAppTargets: Specifies the maximum number of app targets to discover.
Usage:
The TransferTargetDiscoveryOptions class is passed to the TransferTargetWatcher to configure the discovery process.
Constructors
| Name | Description |
|---|---|
| TransferTargetDiscoveryOptions(DataPackageView) |
Initializes a new instance of the |
Properties
| Name | Description |
|---|---|
| AllowedTargetAppIds |
The |
| DataPackage |
The |
| MaxAppTargets |
The |