Class ModuleConfiguration
Properties configuration for a module and those sub modules.
Implements
Inherited Members
Namespace: Loehnert.Lisrt.Modules.Configuration
Assembly: Loehnert.Lisrt.Modules.dll
Syntax
public class ModuleConfiguration : IModuleConfiguration
Properties
ModuleName
Gets or sets the full name.
Declaration
public string ModuleName { get; set; }
Property Value
Type | Description |
---|---|
String |
ModuleType
Gets or sets the full type with assembly name.
Declaration
public string ModuleType { get; set; }
Property Value
Type | Description |
---|---|
String |
Properties
Gets the properties.
Declaration
public ICollection<ConfigurationProperty> Properties { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<ConfigurationProperty> |
SubModuleConfigurations
Gets module configurations for the sub modules.
Declaration
public ICollection<IModuleConfiguration> SubModuleConfigurations { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<IModuleConfiguration> |
Methods
ApplyToModule(ILisrtModule, IStringConverter)
Apply the properties to the module
and those sub modules.
Declaration
public bool ApplyToModule(ILisrtModule module, IStringConverter converter)
Parameters
Type | Name | Description |
---|---|---|
ILisrtModule | module | Target module. |
IStringConverter | converter | A converter that converts a string value to a property value type. |
Returns
Type | Description |
---|---|
Boolean | True if all properties could be found, otherwise false. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.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
.
Declaration
public static bool ApplyToModules(IEnumerable<IModuleConfiguration> configurations, IEnumerable<ILisrtModule> modules, IStringConverter converter)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IModuleConfiguration> | configurations | Configurations to apply. |
IEnumerable<ILisrtModule> | modules | Modules. |
IStringConverter | converter | A converter that converts the configuration properties to a string. |
Returns
Type | Description |
---|---|
Boolean | A value indicating whether applying of all configurations was successful. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when an argument is null. |
CreateFromModule(ILisrtModule, IStringConverter)
Creates a configuration from a ILisrtModule and those sub modules.
Declaration
public static ModuleConfiguration CreateFromModule(ILisrtModule module, IStringConverter converter)
Parameters
Type | Name | Description |
---|---|---|
ILisrtModule | module | Module from which the configuration is created. |
IStringConverter | converter | A converter that converts the configuration properties to a string. |
Returns
Type | Description |
---|---|
ModuleConfiguration | Configuration of the ILisrtModule and those sub modules. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when an argument is null. |
CreateFromModules(IEnumerable<ILisrtModule>, IStringConverter)
Creates a configurations from a ILisrtModule enumeration and those sub modules.
Declaration
public static IEnumerable<ModuleConfiguration> CreateFromModules(IEnumerable<ILisrtModule> modules, IStringConverter converter)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ILisrtModule> | modules | Modules from which the configurations are created. |
IStringConverter | converter | A converter that converts the configuration properties to a string. |
Returns
Type | Description |
---|---|
IEnumerable<ModuleConfiguration> | Configuration of the ILisrtModule and those sub modules. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when an argument is null. |
ToString()
Get the module name.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | Full module name. |