Class ModulesService
Service for create, save and load a configuration.
[Export(typeof(IModulesService))]
public class ModulesService : PropertyChangedBase, INotifyPropertyChangedEx, IModulesService, INotifyPropertyChanged
- Inheritance
-
PropertyChangedBaseModulesService
- Implements
-
INotifyPropertyChangedEx
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.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
IConfigurationManagerManager for loading and saving IModuleConfigurations.
propertyConverter
IStringConverterString converter for the properties.
Fields
RootModuleName
Gets the name for the root module.
public const string RootModuleName = "RootModule"
Field Value
Properties
ConfigurationManager
Gets the IConfigurationManager for loading and saving a IModuleConfiguration.
public IConfigurationManager ConfigurationManager { get; }
Property Value
Remarks
XmlConfigurationManager by default.
CurrentConfigurationName
Gets the name of the current ModuleConfiguration or null.
public string CurrentConfigurationName { get; }
Property Value
ModuleConfigurations
Gets the latest loaded configurations of the root modules.
public IEnumerable<IModuleConfiguration> ModuleConfigurations { get; }
Property Value
PropertyConverter
Gets the string converter to convert property values.
public IStringConverter PropertyConverter { get; }
Property Value
Remarks
StringConverter by default.
RootModules
Gets or sets the "RootModules".ILisrtModule.
public ILisrtModule[] RootModules { get; set; }
Property Value
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
stringPath to the configuration file.
Returns
- bool
True if all ILisrtModules with their sub modules and properties could be loaded to the target.
Remarks
ExitRecursively(ILisrtModule, bool), ApplyToModule(ILisrtModule, IStringConverter) and Initialize() the RootModule.
SaveConfigurationFromRootModule()
Saves the ModuleConfiguration from RootModules with ConfigurationManager.
public void SaveConfigurationFromRootModule()
Remarks
Opens usually a dialog to choose a path.