Singleton class tracking all opened Device objects from drivers. More...
Inherits IDeviceSet.
Public Member Functions | |
IEnumerable< Device > | GetDevices () |
Gets all currently tracked devices. More... | |
bool | Add (Device device) |
Adds a device to the global driver set. More... | |
bool | Remove (Device device) |
Removes the given device from the global driver set. More... | |
bool | Contains (Device deviceToCheck, out Device presentDevice) |
Checks whether an instance equivalent to deviceToCheck is present in this set. More... | |
void | Collect () |
Collects dead weak references and trims the memory. | |
bool | Add (Device device) |
Adds the given device to this set. More... | |
bool | Remove (Device device) |
Removes the given device from this set. More... | |
bool | Contains (Device deviceToCheck, out Device presentDevice) |
Checks whether an instance equivalent to deviceToCheck is present in this set. More... | |
IEnumerable< Device > | GetDevices () |
Gets all currently tracked devices. More... | |
void | Collect () |
Checks this set for expired weak references and trims the set to the actually alive objects. | |
Protected Member Functions | |
void | RaiseAdded (Device device) |
Raises the Added event. More... | |
void | RaiseRemoved (Device device) |
Raises the Removed event. More... | |
Properties | |
int | Count [get] |
Gets the number of tracked devices. | |
Properties inherited from IDeviceSet | |
int | Count [get] |
Gets the number of active devices in this set. | |
Events | |
EventHandler< DeviceEventArgs > | Added |
Occurs when a device is added. | |
EventHandler< DeviceEventArgs > | Removed |
Occurs when a device is removed. More... | |
Singleton class tracking all opened Device objects from drivers.
This affects all devices loaded via the native ImgLib.LoadImageFileW method.
bool Add | ( | Device | device | ) |
Adds a device to the global driver set.
device | Device to add to the set. |
true
if device was not present and thus could be added; false
if it was present and could not be added.Implements IDeviceSet.
Checks whether an instance equivalent to deviceToCheck is present in this set.
deviceToCheck | Device to be checked whether an equivalent device is available in this set. |
presentDevice | Contains the equivalent device which is present in this set if available; null otherwise. |
true
if equivalent device is present; false
if not.Implements IDeviceSet.
IEnumerable< Device > GetDevices | ( | ) |
Gets all currently tracked devices.
Implements IDeviceSet.
|
protected |
|
protected |
Raises the Removed event.
device | Removed device. |
bool Remove | ( | Device | device | ) |
Removes the given device from the global driver set.
device | Device to remove. |
true
if device was present and thus could be removed; false
if it was not present.Implements IDeviceSet.
EventHandler<DeviceEventArgs> Removed |
Occurs when a device is removed.
Beware of using the associated object as it is either disposed or in the process of disposing.