Class ConfiguredDeviceEnumeratorBase
A base class for implementing IConfiguredDeviceEnumerator.
public abstract class ConfiguredDeviceEnumeratorBase : IConfiguredDeviceEnumerator
- Inheritance
-
ConfiguredDeviceEnumeratorBase
- Implements
- Derived
- Inherited Members
Constructors
ConfiguredDeviceEnumeratorBase()
Initializes a new instance of the ConfiguredDeviceEnumeratorBase class that uses the registered device type as the concrete Type of the device (any setting named Type will be ignored).
protected ConfiguredDeviceEnumeratorBase()
ConfiguredDeviceEnumeratorBase(IConfiguredDeviceTypeResolver)
Initializes a new instance of the ConfiguredDeviceEnumeratorBase class using a supplied IConfiguredDeviceTypeResolver.
protected ConfiguredDeviceEnumeratorBase(IConfiguredDeviceTypeResolver typeResolver)
Parameters
typeResolverIConfiguredDeviceTypeResolverThe IConfiguredDeviceTypeResolver to use.
Exceptions
- ArgumentNullException
typeResolveris null.
ConfiguredDeviceEnumeratorBase(Type)
Initializes a new instance of the ConfiguredDeviceEnumeratorBase class that uses a specified concrete device Type (any setting named Type will be ignored).
protected ConfiguredDeviceEnumeratorBase(Type concreteDeviceType)
Parameters
Exceptions
- ArgumentNullException
concreteDeviceTypeis null.
Methods
CreateConfiguredDeviceDefinition(Type, IConfigurationSection)
Creates a ConfiguredDeviceDefinition.
protected ConfiguredDeviceDefinition CreateConfiguredDeviceDefinition(Type baseDeviceType, IConfigurationSection configurationSection)
Parameters
baseDeviceTypeTypeThe base Type for the registered device type.
configurationSectionIConfigurationSectionThe optional configuration section for the device.
Returns
- ConfiguredDeviceDefinition
A ConfiguredDeviceDefinition instance for the type
Remarks
If configurationSection is supplied and there is a Name setting, then Name in the returned ConfiguredDeviceDefinition will reflect the setting value.
If a IConfiguredDeviceTypeResolver was supplied when creating this instance of ConfiguredDeviceEnumeratorBase, then it will be used to determine the concrete device base class. Otherwise, baseDeviceType will be assumed.
EnumerateConfiguredDevices(Type, IConfigurationSection)
Enumerates configured devices.
public abstract IEnumerable<ConfiguredDeviceDefinition> EnumerateConfiguredDevices(Type baseDeviceType, IConfigurationSection configurationSection)
Parameters
baseDeviceTypeTypeThe base Type for the registered device type.
configurationSectionIConfigurationSectionThe configuration section that contains the settings for the device type, which comes from ConfigurationSection in the device type registration options.
Returns
- IEnumerable<ConfiguredDeviceDefinition>
An enumeration of ConfiguredDeviceDefinition objects representing the configured devices.
Exceptions
- ArgumentNullException
configurationSectionis null, but this implementation requires a configuration section to operate.