Class SmartCardDeviceListener
A class that provides events for a smart card device arrival and removal.
public abstract class SmartCardDeviceListener
- Inheritance
-
objectSmartCardDeviceListener
Remarks
This class exposes two events to the caller: Arrived and Removed. As their names suggest, subscribing to these events will inform your code whenever a new smart card device is discovered on the system, or one is removed, respectively.
You will only receive events for devices that were added or removed after you subscribed to the event. That is, arrival events will only be raised for devices added after you have subscribed to the Arrived events. All devices already attached to the system will be ignored.
Properties
Status
A status that indicates the state of the device listener.
public DeviceListenerStatus Status { get; set; }
Property Value
Methods
ClearEventHandlers()
Implementers can call this method to reset the event handlers during cleanup.
protected void ClearEventHandlers()
Create()
Creates an instance of a SmartCardDeviceListener.
public static SmartCardDeviceListener Create()
Returns
- SmartCardDeviceListener
An instance of DesktopSmartCardDeviceListener.
Exceptions
- PlatformNotSupportedException
This class depends on operating system specific support being present. If this exception is being raised, the operating system or platform that you are attempting to run this does not have a smart card device notification support.
OnArrived(ISmartCardDevice)
Implementers should call this method when they have discovered a new smart card device on the system.
protected void OnArrived(ISmartCardDevice device)
Parameters
device
ISmartCardDeviceThe device instance that originates this event.
OnRemoved(ISmartCardDevice)
Implementers should call this method when they have discovered that a smart card device has been removed from the system.
protected void OnRemoved(ISmartCardDevice device)
Parameters
device
ISmartCardDeviceThe device instance that originates this event.
Events
Arrived
Subscribe to receive an event whenever a smart card device is added to the computer.
public event EventHandler<SmartCardDeviceEventArgs>? Arrived
Event Type
- EventHandler<SmartCardDeviceEventArgs>
Removed
Subscribe to receive an event whenever a smart card device is removed from the computer.
public event EventHandler<SmartCardDeviceEventArgs>? Removed
Event Type
- EventHandler<SmartCardDeviceEventArgs>