TransferTargetWatcher.Stop 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 Stop method stops the discovery of transfer targets by the TransferTargetWatcher. Once stopped, the watcher no longer raises events such as Added, Removed, or Updated.
public:
virtual void Stop() = Stop;
/// [Windows.Foundation.Metadata.Experimental]
void Stop();
[Windows.Foundation.Metadata.Experimental]
public void Stop();
function stop()
Public Sub Stop ()
- Attributes
Examples
Example: Stopping the TransferTargetWatcher
watcher.Stop();
Console.WriteLine("TransferTargetWatcher has been stopped.");
Remarks
Calling the Stop method halts the monitoring process of the TransferTargetWatcher. Applications can call this method to conserve resources or when monitoring is no longer needed. The Stopped event is raised when the watcher stops.
Usage Notes:
- Ensure that any ongoing operations related to the watcher are completed before calling
Stop. - The watcher can be restarted by calling the
Startmethod again.