AlpacaClientGetDeviceT(AlpacaConfiguration) Method

Creates and returns an instance of an Alpaca device of the specified type using the provided configuration settings.

Definition

Namespace: ASCOM.Alpaca.Clients
Assembly: ASCOM.Alpaca (in ASCOM.Alpaca.dll) Version: 3.0.0-rc.1+86c25ce733aebb4d8b1b8a62e84770ea5e972bea
C#
public static T GetDevice<T>(
	AlpacaConfiguration configuration
)
where T : new(), AlpacaDeviceBaseClass

Parameters

configuration  AlpacaConfiguration
The configuration settings used to initialize the Alpaca device. Cannot be null.

Type Parameters

T
The type of Alpaca device to create. Must inherit from AlpacaDeviceBaseClass and have a parameterless constructor.

Return Value

T
An instance of type T representing the configured Alpaca device.

Remarks

This method uses the properties of the provided configuration to initialize the device. The returned device is ready for use according to the specified settings.

Exceptions

InvalidValueExceptionThrown if the configuration parameter is null.

Version Information

.NET Standard

Supported in: 2.0

See Also