Exemple #1
0
        /// <summary>
        /// Initializes the model state variables for the GUI to be used in the screen for the configuration
        /// item of the specified <paramref name="configLocation"/> and shows the screen.
        /// </summary>
        /// <param name="configLocation">The configuration location to be shown.</param>
        public void ShowConfigItem(string configLocation)
        {
            _currentLocation = configLocation;
            IConfigurationManager configurationManager = ServiceRegistration.Get <IConfigurationManager>();
            IConfigurationNode    currentNode          = configurationManager.GetNode(configLocation);
            ConfigSetting         configSetting        = currentNode == null ? null : currentNode.ConfigObj as ConfigSetting;

            _currentConfigController = FindConfigurationController(configSetting);
            if (_currentConfigController == null)
            { // Error case: We don't have a configuration controller for the setting to be shown
                ServiceRegistration.Get <ILogger>().Warn(
                    "ConfigurationModel: Cannot show configuration for setting '{0}', no configuration controller available",
                    configSetting);
                return;
            }
            _currentConfigController.Initialize(configSetting);
            _currentConfigController.ExecuteConfiguration();
        }
 /// <summary>
 /// Initializes the model state variables for the GUI to be used in the screen for the configuration
 /// item of the specified <paramref name="configLocation"/> and shows the screen.
 /// </summary>
 /// <param name="configLocation">The configuration location to be shown.</param>
 public void ShowConfigItem(string configLocation)
 {
   _currentLocation = configLocation;
   IConfigurationManager configurationManager = ServiceRegistration.Get<IConfigurationManager>();
   IConfigurationNode currentNode = configurationManager.GetNode(configLocation);
   ConfigSetting configSetting = currentNode == null ? null : currentNode.ConfigObj as ConfigSetting;
   _currentConfigController = FindConfigurationController(configSetting);
   if (_currentConfigController == null)
   { // Error case: We don't have a configuration controller for the setting to be shown
     ServiceRegistration.Get<ILogger>().Warn(
         "ConfigurationModel: Cannot show configuration for setting '{0}', no configuration controller available",
         configSetting);
     return;
   }
   _currentConfigController.Initialize(configSetting);
   _currentConfigController.ExecuteConfiguration();
 }