Table of Contents

Class TypedConfiguredDeviceTypeResolver

Namespace
Acuit.Pinpoint.IO
Assembly
Acuit.Pinpoint.IO.Abstractions.dll

A concrete device type resolver for configured device types with dynamic types specified via a Type configuration setting.

public class TypedConfiguredDeviceTypeResolver : ConfiguredDeviceTypeResolverBase, IConfiguredDeviceTypeResolver
Inheritance
TypedConfiguredDeviceTypeResolver
Implements
Inherited Members

Remarks

See the remarks for ResolveType(Type, IConfigurationSection, string) for more details.

Constructors

TypedConfiguredDeviceTypeResolver()

Initializes a new instance of the TypedConfiguredDeviceTypeResolver class.

public TypedConfiguredDeviceTypeResolver()

Remarks

Default can be used to get a singleton instance created with this constructor.

TypedConfiguredDeviceTypeResolver(string)

Initializes a new instance of the TypedConfiguredDeviceTypeResolver class.

public TypedConfiguredDeviceTypeResolver(string typeNameSuffix)

Parameters

typeNameSuffix string

The type name suffix to use when parsing a device type.

Exceptions

ArgumentNullException

typeNameSuffix is null.

Properties

Default

Gets a default TypedConfiguredDeviceTypeResolver instance.

public static TypedConfiguredDeviceTypeResolver Default { get; }

Property Value

TypedConfiguredDeviceTypeResolver

Methods

ResolveType(Type, IConfigurationSection, string)

Determines the concrete type to use for a configured device.

public override Type ResolveType(Type baseDeviceType, IConfigurationSection configurationSection, string typeValue)

Parameters

baseDeviceType Type

The base Type for the registered device type.

configurationSection IConfigurationSection

The optional configuration section containing settings for this device. This will be null for device type registrations that do not use configuration settings.

typeValue string

The Type setting value. This will be null if the setting does not exist.

Returns

Type

The concrete type to use.

Remarks

The default implementation throws an InvalidOperationException with a 'The Type setting "typeValue" is invalid' message, so in overrides, if the type resolution fails, they can simply call the base class to cause an appropriate exception to be thrown.

Exceptions

ArgumentNullException

baseDeviceType is null.

InvalidOperationException

The type could not be determined.