Share via


PerceptionColorFrameSourceWatcher.SourceAdded Event

Definition

Subscribes to the SourceAdded event.

// Register
event_token SourceAdded(TypedEventHandler<PerceptionColorFrameSourceWatcher, PerceptionColorFrameSourceAddedEventArgs const&> const& handler) const;

// Revoke with event_token
void SourceAdded(event_token const* cookie) const;

// Revoke with event_revoker
PerceptionColorFrameSourceWatcher::SourceAdded_revoker SourceAdded(auto_revoke_t, TypedEventHandler<PerceptionColorFrameSourceWatcher, PerceptionColorFrameSourceAddedEventArgs const&> const& handler) const;
/// [add: Windows.Foundation.Metadata.Deprecated("PerceptionColorFrameSourceWatcher may be unavailable after Windows Creator Update.  Use Windows.Devices.Enumeration.DeviceWatcher instead.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
/// [remove: Windows.Foundation.Metadata.Deprecated("PerceptionColorFrameSourceWatcher may be unavailable after Windows Creator Update.  Use Windows.Devices.Enumeration.DeviceWatcher instead.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
// Register
event_token SourceAdded(TypedEventHandler<PerceptionColorFrameSourceWatcher, PerceptionColorFrameSourceAddedEventArgs const&> const& handler) const;

// Revoke with event_token
void SourceAdded(event_token const* cookie) const;

// Revoke with event_revoker
PerceptionColorFrameSourceWatcher::SourceAdded_revoker SourceAdded(auto_revoke_t, TypedEventHandler<PerceptionColorFrameSourceWatcher, PerceptionColorFrameSourceAddedEventArgs const&> const& handler) const;
public event TypedEventHandler<PerceptionColorFrameSourceWatcher,PerceptionColorFrameSourceAddedEventArgs> SourceAdded;
[add: Windows.Foundation.Metadata.Deprecated("PerceptionColorFrameSourceWatcher may be unavailable after Windows Creator Update.  Use Windows.Devices.Enumeration.DeviceWatcher instead.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
[remove: Windows.Foundation.Metadata.Deprecated("PerceptionColorFrameSourceWatcher may be unavailable after Windows Creator Update.  Use Windows.Devices.Enumeration.DeviceWatcher instead.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
public event TypedEventHandler<PerceptionColorFrameSourceWatcher,PerceptionColorFrameSourceAddedEventArgs> SourceAdded;
function onSourceAdded(eventArgs) { /* Your code */ }
perceptionColorFrameSourceWatcher.addEventListener("sourceadded", onSourceAdded);
perceptionColorFrameSourceWatcher.removeEventListener("sourceadded", onSourceAdded);
- or -
perceptionColorFrameSourceWatcher.onsourceadded = onSourceAdded;
Public Custom Event SourceAdded As TypedEventHandler(Of PerceptionColorFrameSourceWatcher, PerceptionColorFrameSourceAddedEventArgs) 

Event Type

Attributes

Remarks

When the Start method is called, this event is fired for every color frame source already known to the system, then the EnumerationCompleted event is fired. New color frame sources that are subsequently added will trigger additional SourceAdded events.

Applies to