Table of Contents

Class ModulesService

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

Service for create, save and load a configuration.

[Export(typeof(IModulesService))]
public class ModulesService : PropertyChangedBase, INotifyPropertyChangedEx, IModulesService, INotifyPropertyChanged
Inheritance
PropertyChangedBase
ModulesService
Implements
INotifyPropertyChangedEx
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.PropertyChanged
Extension Methods

Constructors

ModulesService(ILisrtModule[], IConfigurationManager, IStringConverter)

Initializes a new instance of the ModulesService class.

[ImportingConstructor]
public ModulesService(ILisrtModule[] rootModules, IConfigurationManager configurationManager, IStringConverter propertyConverter)

Parameters

rootModules ILisrtModule[]

Root module, without Parent.

configurationManager IConfigurationManager

Manager for loading and saving IModuleConfigurations.

propertyConverter IStringConverter

String converter for the properties.

Fields

RootModuleName

Gets the name for the root module.

public const string RootModuleName = "RootModule"

Field Value

string

Properties

ConfigurationManager

Gets the IConfigurationManager for loading and saving a IModuleConfiguration.

public IConfigurationManager ConfigurationManager { get; }

Property Value

IConfigurationManager

Remarks

CurrentConfigurationName

Gets the name of the current ModuleConfiguration or null.

public string CurrentConfigurationName { get; }

Property Value

string

ModuleConfigurations

Gets the latest loaded configurations of the root modules.

public IEnumerable<IModuleConfiguration> ModuleConfigurations { get; }

Property Value

IEnumerable<IModuleConfiguration>

PropertyConverter

Gets the string converter to convert property values.

public IStringConverter PropertyConverter { get; }

Property Value

IStringConverter

Remarks

StringConverter by default.

RootModules

Gets or sets the "RootModules".ILisrtModule.

public ILisrtModule[] RootModules { get; set; }

Property Value

ILisrtModule[]

Methods

LoadConfigurationToRootModule()

Opens a dialog and loads the ModuleConfiguration to the RootModules with ConfigurationManager and new initialization.

public bool LoadConfigurationToRootModule()

Returns

bool

True if all ILisrtModules with their sub modules and properties could be loaded to the target.

Remarks

Opens usually a dialog to choose a path. ExitRecursively(ILisrtModule, bool), ApplyToModule(ILisrtModule, IStringConverter) and Initialize() the RootModule.

LoadConfigurationToRootModule(string)

Loads the ModuleConfiguration from the path to the RootModules using ConfigurationManager and new initialization.

public bool LoadConfigurationToRootModule(string path)

Parameters

path string

Path to the configuration file.

Returns

bool

True if all ILisrtModules with their sub modules and properties could be loaded to the target.

Remarks

SaveConfigurationFromRootModule()

public void SaveConfigurationFromRootModule()

Remarks

Opens usually a dialog to choose a path.