TransferTargetWatcher.Stopped Event
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 Stopped event occurs when the TransferTargetWatcher stops monitoring for transfer targets. This event is raised to notify applications that the watcher has been stopped, either programmatically or due to an error.
/// [Windows.Foundation.Metadata.Experimental]
/// [add: Windows.Foundation.Metadata.Experimental]
/// [remove: Windows.Foundation.Metadata.Experimental]
// Register
event_token Stopped(TypedEventHandler<TransferTargetWatcher, IInspectable const&> const& handler) const;
// Revoke with event_token
void Stopped(event_token const* cookie) const;
// Revoke with event_revoker
TransferTargetWatcher::Stopped_revoker Stopped(auto_revoke_t, TypedEventHandler<TransferTargetWatcher, IInspectable const&> const& handler) const;
[Windows.Foundation.Metadata.Experimental]
[add: Windows.Foundation.Metadata.Experimental]
[remove: Windows.Foundation.Metadata.Experimental]
public event TypedEventHandler<TransferTargetWatcher,object> Stopped;
function onStopped(eventArgs) { /* Your code */ }
transferTargetWatcher.addEventListener("stopped", onStopped);
transferTargetWatcher.removeEventListener("stopped", onStopped);
- or -
transferTargetWatcher.onstopped = onStopped;
Public Custom Event Stopped As TypedEventHandler(Of TransferTargetWatcher, Object)
Event Type
TypedEventHandler<TransferTargetWatcher,IInspectable>
- Attributes
Examples
Example: Handling the Stopped Event
watcher.Stopped += (sender, args) =>
{
Console.WriteLine("TransferTargetWatcher has stopped.");
};
Remarks
Applications can handle the Stopped event to perform cleanup or update their state when the TransferTargetWatcher is no longer active. This ensures that the application does not attempt to interact with the watcher after it has stopped.
Event Arguments:
object: Reserved for future use; currently does not provide additional data.