Platforms to show: All Mac Windows Linux Cross-Platform
WindowsDeviceWatcherMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Bluetooth | MBS WinFrameworks Plugin | 24.3 | ❌ No | ✅ Yes | ❌ No | ❌ No | Desktop, Console & Web |
An app calls Start to begin the search for devices. During this initial enumeration, the DeviceWatcher raises an Added event for each device that's found, until all devices are found. The DeviceWatcher raises an EnumerationCompleted event when the initial enumeration is complete, and continues to raise events if a device is added, updated, or removed.
The following diagram shows how the DeviceWatcher transitions between the states represented by DeviceWatcherStatus enumeration.
The Start method can only be called when the DeviceWatcher is in the Created, Stopped or Aborted state. The Status property indicates the DeviceWatcher state. When re-starting the watcher, wait for the Stopped event before calling Start.
Stop transitions the DeviceWatcher to the Stopping state and completes immediately. The watcher will transition to the Stopped state once all events that are already in the process of being raised have completed.
Apps may wait for the Stopped event if they need to know when the DeviceWatcher has stopped. Callers must wait for the Stopped event before they can call Start to restart the watcher. Callers may unsubscribe from events if they do not want to receive any additional events after Stop but do not want to wait for the Stopped event.
- 5 events
- event Added(Device as WindowsDeviceInformationMBS)
- event EnumerationCompleted()
- event Removed(Device as WindowsDeviceInformationUpdateMBS)
- event Stopped()
- event Updated(Device as WindowsDeviceInformationUpdateMBS)
- 2 properties
- 6 methods
- method Constructor
- method Constructor(aqsFilter as String)
- method Constructor(DeviceClass as Integer)
- method Destructor
- method Start
- method Stop
- 13 constants
Device Class
Constant | Value | Description |
---|---|---|
DeviceClassAll | 0 |
Indicates that the user wants to enumerate all devices. |
DeviceClassAudioCapture | 1 |
Indicates that the user wants to enumerate all audio capture devices. |
DeviceClassAudioRender | 2 |
Indicates that the user wants to enumerate all audio rendering devices. |
DeviceClassImageScanner | 5 |
Indicates that the user wants to enumerate all scanning devices. |
DeviceClassLocation | 6 |
Indicates that the user wants to enumerate all location aware devices. |
DeviceClassPortableStorageDevice | 3 |
Indicates that the user wants to enumerate all portable storage devices. |
DeviceClassVideoCapture | 4 |
Indicates that the user wants to enumerate all video capture devices. |
Status
Constant | Value | Description |
---|---|---|
StatusStatusAborted | 5 |
The watcher has aborted operation. No subsequent events will be raised. |
StatusStatusCreated | 0 |
This is the initial state of a Watcher object. During this state clients can register event handlers. |
StatusStatusEnumerationCompleted | 2 |
The watcher has completed enumerating the initial collection. Items can still be added, updated or removed from the collection. |
StatusStatusStarted | 1 |
The watcher transitions to the Started state once Start is called. The watcher is enumerating the initial collection. Note that during this enumeration phase it is possible to receive Updated and Removed notifications but only to items that have already been Added. |
StatusStatusStopped | 4 |
The client has called Stop and the watcher has completed all outstanding events. No further events will be raised. |
StatusStatusStopping | 3 |
The client has called Stop and the watcher is still in the process of stopping. Events may still be raised. |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 24.4pr1
- News from the MBS Xojo Plugins Version 24.3
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.3
- MBS Xojo Plugins, version 24.3pr4
Release notes
- Version 24.4
- Fixed WindowsDeviceWatcherMBS class to pass an WindowsDeviceInformationUpdateMBS for Updated event.
- Version 24.3
- Added WindowsDeviceWatcherMBS, WindowsDeviceInformationUpdateMBS and WindowsDeviceInformationMBS classes.
The items on this page are in the following plugins: MBS WinFrameworks Plugin.
WindowsDevicePairingRequestedEventArgsMBS - WindowsDirectoryChangeMBS