Share via


TransferTargetWatcher.Start Method

Definition

The Start method begins the discovery of transfer targets by the TransferTargetWatcher. Once started, the watcher raises events such as Added, Removed, and Updated to notify the application about changes in available transfer targets.

public:
 virtual void Start() = Start;
/// [Windows.Foundation.Metadata.Experimental]
void Start();
[Windows.Foundation.Metadata.Experimental]
public void Start();
function start()
Public Sub Start ()
Attributes

Examples

Example: Starting the TransferTargetWatcher

var watcher = TransferTarget.CreateWatcher();
watcher.Added += (sender, args) =>
{
    Console.WriteLine($"Target added: {args.Target.Label}");
};

watcher.Start();

Remarks

Calling the Start method enables the TransferTargetWatcher to actively monitor for transfer targets. Applications should ensure that the watcher is properly configured before calling this method. The watcher continues to monitor until the Stop method is called.

Usage Notes:

  • Ensure that event handlers for Added, Removed, and other events are registered before starting the watcher.
  • The watcher may raise the EnumerationCompleted event after the initial discovery phase.

Applies to

See also