AllJoynBusAttachment.StateChanged 事件

定义

重要

Windows.Devices.AllJoyn 命名空间中的类型已弃用,将来的 Windows 版本中可能不可用。 AllJoyn(由 AllSeen Alliance 赞助)是一种开源发现和通信协议,适用于物联网 (IoT) 方案,例如开灯和关灯以及读取温度。 有关替代项(如 IoTivity LiteIoTivity),请参阅 iotivity.org 网站。

在总线附件的状态更改时发生。 AllJoynBusAttachmentState 枚举定义可能的状态值。

// Register
event_token StateChanged(TypedEventHandler<AllJoynBusAttachment, AllJoynBusAttachmentStateChangedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
AllJoynBusAttachment::StateChanged_revoker StateChanged(auto_revoke_t, TypedEventHandler<AllJoynBusAttachment, AllJoynBusAttachmentStateChangedEventArgs const&> const& handler) const;
/// [add: Windows.Foundation.Metadata.Deprecated("AllJoynBusAttachment has been deprecated.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 786432, "Windows.Foundation.UniversalApiContract")]
/// [remove: Windows.Foundation.Metadata.Deprecated("AllJoynBusAttachment has been deprecated.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 786432, "Windows.Foundation.UniversalApiContract")]
// Register
event_token StateChanged(TypedEventHandler<AllJoynBusAttachment, AllJoynBusAttachmentStateChangedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
AllJoynBusAttachment::StateChanged_revoker StateChanged(auto_revoke_t, TypedEventHandler<AllJoynBusAttachment, AllJoynBusAttachmentStateChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<AllJoynBusAttachment,AllJoynBusAttachmentStateChangedEventArgs> StateChanged;
[add: Windows.Foundation.Metadata.Deprecated("AllJoynBusAttachment has been deprecated.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 786432, "Windows.Foundation.UniversalApiContract")]
[remove: Windows.Foundation.Metadata.Deprecated("AllJoynBusAttachment has been deprecated.  For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 786432, "Windows.Foundation.UniversalApiContract")]
public event TypedEventHandler<AllJoynBusAttachment,AllJoynBusAttachmentStateChangedEventArgs> StateChanged;
function onStateChanged(eventArgs) { /* Your code */ }
allJoynBusAttachment.addEventListener("statechanged", onStateChanged);
allJoynBusAttachment.removeEventListener("statechanged", onStateChanged);
- or -
allJoynBusAttachment.onstatechanged = onStateChanged;
Public Custom Event StateChanged As TypedEventHandler(Of AllJoynBusAttachment, AllJoynBusAttachmentStateChangedEventArgs) 

事件类型

属性

Windows 要求

应用功能
allJoyn

适用于