Class ComponentDataFactory
- Namespace
- Tudormobile.IronLedgerLib
- Assembly
- Tudormobile.IronLedgerLib.dll
Factory for creating collections of component data from various hardware components.
public class ComponentDataFactory : IComponentDataFactory
- Inheritance
-
ComponentDataFactory
- Implements
- Inherited Members
Constructors
ComponentDataFactory(IComponentDataProvider?, IComponentDataProvider?, IComponentDataProvider?, IComponentDataProvider?, ILogger<ComponentDataFactory>?)
Initializes a new instance of the ComponentDataFactory class.
public ComponentDataFactory(IComponentDataProvider? processorProvider = null, IComponentDataProvider? systemProvider = null, IComponentDataProvider? memoryProvider = null, IComponentDataProvider? diskProvider = null, ILogger<ComponentDataFactory>? logger = null)
Parameters
processorProviderIComponentDataProviderThe provider for processor component data. If null, uses the default Windows WMI provider.
systemProviderIComponentDataProviderThe provider for system component data. If null, uses the default Windows WMI provider.
memoryProviderIComponentDataProviderThe provider for memory component data. If null, uses the default Windows WMI provider.
diskProviderIComponentDataProviderThe provider for disk component data. If null, uses the default Windows WMI provider.
loggerILogger<ComponentDataFactory>The logger for diagnostic and error messages. If null, logging is suppressed.
Methods
Create()
Creates a new SystemComponentData by collecting data from all configured providers.
public SystemComponentData Create()
Returns
- SystemComponentData
A new SystemComponentData instance populated with data from all hardware components.
Exceptions
- ComponentDataProviderException
Thrown when any of the configured providers fail to retrieve data.
GetDisks()
Gets disk component data.
public IReadOnlyList<ComponentData> GetDisks()
Returns
- IReadOnlyList<ComponentData>
A collection of disk component data.
Exceptions
- ComponentDataProviderException
Thrown when the disk provider fails to retrieve data.
GetMemory()
Gets memory component data.
public IReadOnlyList<ComponentData> GetMemory()
Returns
- IReadOnlyList<ComponentData>
A collection of memory component data.
Exceptions
- ComponentDataProviderException
Thrown when the memory provider fails to retrieve data.
GetProcessors()
Gets processor component data.
public IReadOnlyList<ComponentData> GetProcessors()
Returns
- IReadOnlyList<ComponentData>
A collection of processor component data.
Exceptions
- ComponentDataProviderException
Thrown when the processor provider fails to retrieve data.
GetSystem()
Gets system component data.
public ComponentData GetSystem()
Returns
- ComponentData
System component data.
Exceptions
- ComponentDataProviderException
Thrown when the system provider fails to retrieve data.