Table of Contents

Class ModuleConfiguration

Namespace
Loehnert.Lisrt.Modules.Configuration
Assembly
Loehnert.Lisrt.Modules.dll

Properties configuration for a module and those sub modules.

public class ModuleConfiguration : IModuleConfiguration
Inheritance
ModuleConfiguration
Implements
Inherited Members
Extension Methods

Properties

ModuleName

Gets or sets the full name.

public string ModuleName { get; set; }

Property Value

string

ModuleType

Gets or sets the full type with assembly name.

public string ModuleType { get; set; }

Property Value

string

Properties

Gets the properties.

public ICollection<ConfigurationProperty> Properties { get; }

Property Value

ICollection<ConfigurationProperty>

SubModuleConfigurations

Gets module configurations for the sub modules.

public ICollection<IModuleConfiguration> SubModuleConfigurations { get; }

Property Value

ICollection<IModuleConfiguration>

Methods

ApplyToModule(ILisrtModule, IStringConverter)

Apply the properties to the module and those sub modules.

public bool ApplyToModule(ILisrtModule module, IStringConverter converter)

Parameters

module ILisrtModule

Target module.

converter IStringConverter

A converter that converts a string value to a property value type.

Returns

bool

True if all properties could be found, otherwise false.

Exceptions

ArgumentNullException

Thrown when module or converter is null.

ArgumentException

Thrown when IsRoot(ILisrtModule) = true and ModuleName is not the name of the given module and/or when IsRoot(ILisrtModule) = true and ModuleType starts not with the type and assembly name of the given module.

ApplyToModules(IEnumerable<IModuleConfiguration>, IEnumerable<ILisrtModule>, IStringConverter)

Applies configurations to modules.

public static bool ApplyToModules(IEnumerable<IModuleConfiguration> configurations, IEnumerable<ILisrtModule> modules, IStringConverter converter)

Parameters

configurations IEnumerable<IModuleConfiguration>

Configurations to apply.

modules IEnumerable<ILisrtModule>

Modules.

converter IStringConverter

A converter that converts the configuration properties to a string.

Returns

bool

A value indicating whether applying of all configurations was successful.

Exceptions

ArgumentNullException

Thrown when an argument is null.

CreateFromModule(ILisrtModule, IStringConverter)

Creates a configuration from a ILisrtModule and those sub modules.

public static ModuleConfiguration CreateFromModule(ILisrtModule module, IStringConverter converter)

Parameters

module ILisrtModule

Module from which the configuration is created.

converter IStringConverter

A converter that converts the configuration properties to a string.

Returns

ModuleConfiguration

Configuration of the ILisrtModule and those sub modules.

Exceptions

ArgumentNullException

Thrown when an argument is null.

CreateFromModules(IEnumerable<ILisrtModule>, IStringConverter)

Creates a configurations from a ILisrtModule enumeration and those sub modules.

public static IEnumerable<ModuleConfiguration> CreateFromModules(IEnumerable<ILisrtModule> modules, IStringConverter converter)

Parameters

modules IEnumerable<ILisrtModule>

Modules from which the configurations are created.

converter IStringConverter

A converter that converts the configuration properties to a string.

Returns

IEnumerable<ModuleConfiguration>

Configuration of the ILisrtModule and those sub modules.

Exceptions

ArgumentNullException

Thrown when an argument is null.

ToString()

Get the module name.

public override string ToString()

Returns

string

Full module name.