TransferTarget.CreateWatcher(TransferTargetDiscoveryOptions) Method
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 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
optionsparameter is properly configured before calling this method. - The returned watcher must be started using the
Startmethod to begin discovery.