TransferTargetWatcher.Start 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 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
EnumerationCompletedevent after the initial discovery phase.