PrimoBurner for .NET  5.0
CD, DVD and Blu-ray Software Development Kit
Loading...
Searching...
No Matches
DeviceEnumerator Class Reference

Device enumerator. More...

Inherits IDisposable.

Public Member Functions

Device CreateDevice (Int32 index)
 Creates and returns a Device object that can be used to control an optical device.
 
Device CreateDevice (Int32 index, bool exclusiveAccess)
 Creates and returns a Device object that can be used to control an optical device.
 
Device CreateDeviceFromSystemPath (string systemPath)
 Creates and returns a Device object that can be used to control an optical device.
 
Device CreateDeviceFromSystemPath (string systemPath, bool exclusiveAccess)
 Creates and returns a Device object that can be used to control an optical device.
 
void Dispose ()
 Disposes DeviceEnumerator and reclaims the resources used by the object.
 

Properties

string CallerName [get, set]
 Gets/Sets the name of the application that will require exclusive access for a device.
 
Int32 Count [get]
 Number of devices installed in the system.
 
ErrorInfo Error [get]
 Returns information about the last error that occurred while using the DeviceEnumerator object.
 

Detailed Description

Device enumerator.

Member Function Documentation

◆ CreateDevice() [1/2]

Device CreateDevice ( Int32  index)

Creates and returns a Device object that can be used to control an optical device.


Calling this method resets and initializes the device before the device object is returned to the application.

This method should not be called after the Device.StartCDSession, Device.StartDVDSession and
DataDisc.WriteToDisc methods.

This method does not obtain exclusive access for the device.

Parameters
indexThe index of the device. The value should be between 0 and the value returned from the Count property.
Returns
A new instance of Device type. After you finish with the device you must call the Dispose method to free the device instance. The method returns null if the optical device could not be fetched.
Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.
See also
DeviceEnumerator.CallerName

References DeviceEnumerator.CreateDevice().

Referenced by DeviceEnumerator.CreateDevice().

◆ CreateDevice() [2/2]

Device CreateDevice ( Int32  index,
bool  exclusiveAccess 
)

Creates and returns a Device object that can be used to control an optical device.

Calling this method resets and initializes the device before the device object is returned to the application.

This method should not be called after the StartCDSession, Device.StartDVDSession and
DataDisc.WriteToDisc methods.

Parameters
indexThe index of the device. The value should be between 0 and the value returned from the Count property.
exclusiveAccessIndicates whether exclusive access to the device is needed.
Returns
A new instance of Device type. After you finish with the device you must call the Dispose method to free the device instance. The method returns null if the optical device could not be fetched.
Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.
See also
DeviceEnumerator.CallerName

◆ CreateDeviceFromSystemPath() [1/2]

Device CreateDeviceFromSystemPath ( string  systemPath)

Creates and returns a Device object that can be used to control an optical device.

Calling this method resets and initializes the device before the device object is returned to the application.

This method should not be called after the StartCDSession, Device.StartDVDSession and
DataDisc.WriteToDisc methods.

This method does not obtain exclusive access for the device.

Parameters
systemPathThe device path identifying the requested optical drive - represents the device interface path of the requested device.
Returns
A new instance of Device type. After you finish with the device you must call the Dispose method to free the device instance. The method returns null if the optical device could not be fetched.
Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.
See also
DeviceEnumerator.CallerName, Device.SystemPath

References DeviceEnumerator.CreateDeviceFromSystemPath().

Referenced by DeviceEnumerator.CreateDeviceFromSystemPath().

◆ CreateDeviceFromSystemPath() [2/2]

Device CreateDeviceFromSystemPath ( string  systemPath,
bool  exclusiveAccess 
)

Creates and returns a Device object that can be used to control an optical device.

Calling this method resets and initializes the device before the device object is returned to the application.

This method should not be called after the StartCDSession, Device.StartDVDSession and
DataDisc.WriteToDisc methods.

Parameters
systemPathThe device path identifying the requested optical drive - represents the device interface path of the requested device.
exclusiveAccessIndicates whether exclusive access to the device is needed.
Returns
A new instance of Device type. After you finish with the device you must call the Dispose method to free the device instance. The method returns null if the optical device could not be fetched.
Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.
See also
DeviceEnumerator.CallerName, Device.SystemPath

Property Documentation

◆ CallerName

string CallerName
getset

Gets/Sets the name of the application that will require exclusive access for a device.

Use this property to set the desired name before trying to obtain exclusive device access.

The name of the application that will require exclusive access to a device. The name must contain alphanumerics (A - Z, a - z, 0 - 9), spaces, periods, commas, colons (:), semi-colons (;), hyphens (-), and underscores (_). It must be less than or equal to 64 bytes in length, including the NULL character at the end of the string.

NOTES:

If a device is not requested with exclusive access, the identifier set with this property is ignored. The default value of this property is 'PrimoBurner SDK'

Setting this property when running on systems prior to Windows Vista has no effect.

Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.
See also
DeviceEnumerator.CreateDevice, DeviceEnumerator.CreateDeviceFromSystemPath

◆ Count

Int32 Count
get

Number of devices installed in the system.

Returns
Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.

◆ Error

ErrorInfo Error
get

Returns information about the last error that occurred while using the DeviceEnumerator object.

Exceptions
ObjectDisposedExceptionThe DeviceEnumerator object was already disposed.