Class ConfiguredDeviceTypeResolverBase
A base class for implementing IConfiguredDeviceTypeResolver.
public abstract class ConfiguredDeviceTypeResolverBase : IConfiguredDeviceTypeResolver
- Inheritance
-
ConfiguredDeviceTypeResolverBase
- Implements
- Derived
- Inherited Members
Constructors
ConfiguredDeviceTypeResolverBase()
protected ConfiguredDeviceTypeResolverBase()
Methods
ResolveType(Type, IConfigurationSection?, string?)
Determines the concrete type to use for a configured device.
public virtual Type ResolveType(Type baseDeviceType, IConfigurationSection? configurationSection, string? typeValue)
Parameters
baseDeviceTypeTypeThe base Type for the registered device type.
configurationSectionIConfigurationSectionThe configuration section containing settings for this device, or null for device type registrations that do not use configuration settings.
typeValuestringThe Type setting value, or 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
baseDeviceTypeis null.- InvalidOperationException
The type could not be determined.