Class DeviceConfigManager
Handles device configuration tasks for Phoenix.
Inheritance
Inherited Members
Namespace: Phoenix.DeviceConfiguration
Assembly: Phoenix.DeviceConfiguration.dll
Syntax
public class DeviceConfigManager : IDeviceConfigManager, IDisposable
Constructors
View SourceDeviceConfigManager(IDeviceCommandManager, IPhoenixLogger, IDeviceManager, IEventAggregator, ISettingsManager)
Initializes a new instance of the DeviceConfigManager class.
Declaration
public DeviceConfigManager(IDeviceCommandManager commands, IPhoenixLogger logger, IDeviceManager deviceManager, IEventAggregator eventAggregator, ISettingsManager settingsManager)
Parameters
Type | Name | Description |
---|---|---|
IDeviceCommandManager | commands | The device command manager implementation. |
IPhoenixLogger | logger | The logger. |
IDeviceManager | deviceManager | The device manager. |
IEventAggregator | eventAggregator | The event service. |
ISettingsManager | settingsManager | The settings manager. |
Fields
View SourceCommandCategory
Declaration
public const string CommandCategory = "Kit Config"
Field Value
Type | Description |
---|---|
System.String |
Properties
View SourceConfigurations
Gets the configurations that have been loaded.
Declaration
public IReadOnlyCollection<IDeviceConfiguration> Configurations { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<IDeviceConfiguration> |
IconUri
Gets the device config icon Uri.
Declaration
public Uri IconUri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
Settings
Gets a lookup of settings available to device configurations.
Declaration
public ILookup<string, SettingInformation> Settings { get; }
Property Value
Type | Description |
---|---|
System.Linq.ILookup<System.String, SettingInformation> |
UserConfigurationsLocation
Gets the default folder path for user-created device configurations.
Declaration
public string UserConfigurationsLocation { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceChangeDeviceEnlistment(IDevice, String)
Changes a devices enlistment to the specific configuration.
Declaration
public void ChangeDeviceEnlistment(IDevice device, string configName)
Parameters
Type | Name | Description |
---|---|---|
IDevice | device | The device to enlist. |
System.String | configName | The configuration to enlist in. |
CreateSettingsList(IEnumerable<IDevice>, IDeviceConfiguration)
Creates the list of settings for a given configuration and device.
Declaration
public Collection<DeviceConfigSetting> CreateSettingsList(IEnumerable<IDevice> devices, IDeviceConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IDevice> | devices | The devices to create the settings for. |
IDeviceConfiguration | config | The configuration containing the settings. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<DeviceConfigSetting> | A collection of the available settings. |
Dispose()
Disposes the config manager
Declaration
public void Dispose()
Dispose(Boolean)
Disposes the config manager resources
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | True if disposing the managed resources |
GetConfiguration(String)
Gets the specified configuration.
Declaration
public IDeviceConfiguration GetConfiguration(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the configuration. |
Returns
Type | Description |
---|---|
IDeviceConfiguration | The IDeviceConfiguration. |
LoadConfigurationSettings(IDeviceConfiguration, Boolean)
Loads settings from a IDeviceConfiguration object.
Declaration
public void LoadConfigurationSettings(IDeviceConfiguration config, bool overwrite)
Parameters
Type | Name | Description |
---|---|---|
IDeviceConfiguration | config | The IDeviceConfiguration object to load. |
System.Boolean | overwrite | Overwrite existing configurations or settings values if they already exist. |
LoadConfigurationSettings(String, Boolean)
Loads one or more configurations from a settings file.
Declaration
public IReadOnlyCollection<IDeviceConfiguration> LoadConfigurationSettings(string configurationFile, bool overwrite)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationFile | The path to a configuration settings file. |
System.Boolean | overwrite | Overwrite existing configurations or settings values if they already exist. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<IDeviceConfiguration> | The configurations loaded. |
LoadConfigurationsFromFile(String)
Loads one or more configurations from a settings file.
Declaration
public static List<DeviceConfiguration> LoadConfigurationsFromFile(string configurationFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationFile | The path to a configuration settings file. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DeviceConfiguration> | The loaded DeviceConfiguration objects. |
SaveConfigurationsToFile(String, IEnumerable<IDeviceConfiguration>)
Saves one or more configurations to a settings file.
Declaration
public void SaveConfigurationsToFile(string configurationFile, IEnumerable<IDeviceConfiguration> configurations)
Parameters
Type | Name | Description |
---|---|---|
System.String | configurationFile | The path to save the configuration settings file. |
System.Collections.Generic.IEnumerable<IDeviceConfiguration> | configurations | The configurations to save. |