Share via


TransferTarget.CreateWatcher(TransferTargetDiscoveryOptions) Method

Definition

The CreateWatcher method creates a new instance of the TransferTargetWatcher class, configured with the specified discovery options. This method allows applications to customize the discovery process for transfer targets.

public:
 static TransferTargetWatcher ^ CreateWatcher(TransferTargetDiscoveryOptions ^ options);
/// [Windows.Foundation.Metadata.Experimental]
 static TransferTargetWatcher CreateWatcher(TransferTargetDiscoveryOptions const& options);
[Windows.Foundation.Metadata.Experimental]
public static TransferTargetWatcher CreateWatcher(TransferTargetDiscoveryOptions options);
function createWatcher(options)
Public Shared Function CreateWatcher (options As TransferTargetDiscoveryOptions) As TransferTargetWatcher

Parameters

options
TransferTargetDiscoveryOptions

The TransferTargetDiscoveryOptions used to configure the watcher. These options specify criteria such as allowed target app IDs and the maximum number of targets to discover.

Returns

A TransferTargetWatcher instance configured with the provided discovery options.

Attributes

Examples

Example: Creating and Starting a TransferTargetWatcher

var options = new TransferTargetDiscoveryOptions
{
    AllowedTargetAppIds = new List<string> { "App1", "App2" },
    MaxAppTargets = 5
};

var watcher = TransferTarget.CreateWatcher(options);
watcher.Start();

Remarks

The CreateWatcher method is a static method that initializes a TransferTargetWatcher with the specified options. Applications can use this method to tailor the discovery process to their specific needs.

Usage Notes:

  • Ensure that the options parameter is properly configured before calling this method.
  • The returned watcher must be started using the Start method to begin discovery.

Applies to

See also