Exemplo n.º 1
0
        internal ServiceLocatorConfiguration LoadConfigSource()
        {
            string configFilePath;

            if (Path.IsPathRooted(this.ConfigFilePath))
            {
                configFilePath = this.ConfigFilePath;
            }
            else
            {
                string configFileFolder = Path.GetDirectoryName(this.ElementInformation.Source);

                configFilePath = Path.Combine(configFileFolder, this.ConfigFilePath);
            }

            ServiceLocatorConfiguration result = ConfigurationHelpers.Load <ServiceLocatorConfiguration>(ServiceLocatorConfiguration.AppSectionName, configFilePath);

            if (result == null)
            {
                throw new ConfigurationErrorsException(
                          "Configuration source file '{0}' was not found.".FormatInvariant(this.ConfigFilePath),
                          this.ElementInformation.Source,
                          this.ElementInformation.LineNumber);
            }

            return(result);
        }
 private static ServiceLocatorConfiguration LoadConfiguration(string configurationFilePath)
 {
     return(ConfigurationHelpers.Load <ServiceLocatorConfiguration>(ServiceLocatorConfiguration.AppSectionName, Path.Combine("ServiceLocator", "Config", configurationFilePath)));
 }
 /// <summary>
 /// Prevents a default instance of the <see cref="RadoslavServiceLocator"/> class from being created.
 /// </summary>
 /// <exception cref="ConfigurationErrorsException">Failed to load configuration from App.config file.</exception>
 private RadoslavServiceLocator()
     : this(ConfigurationHelpers.Load <ServiceLocatorConfiguration>(ServiceLocatorConfiguration.AppSectionName))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RadoslavServiceLocator"/> class.
 /// </summary>
 /// <param name="configurationFilePath">Path to a service locator configuration file.</param>
 /// <exception cref="ConfigurationErrorsException">Failed to load configuration from the specified file.</exception>
 public RadoslavServiceLocator(string configurationFilePath)
     : this(ConfigurationHelpers.Load <ServiceLocatorConfiguration>(ServiceLocatorConfiguration.AppSectionName, configurationFilePath))
 {
 }
Exemplo n.º 5
0
        private static ITaskSchedulerConfiguration GetTaskSchedulerConfiguration(string configFileName)
        {
            string configFilePath = Path.Combine("Configuration", "TaskScheduler", configFileName + ".config");

            return(ConfigurationHelpers.Load <TaskSchedulerConfigurationSection>(TaskSchedulerConfigurationSection.SectionName, configFilePath));
        }
Exemplo n.º 6
0
        private static ITaskProcessorSerializationConfiguration GetSerializationtConfiguration(string configFileName)
        {
            string configFilePath = Path.Combine("Configuration", "Serialization", configFileName + ".config");

            return(ConfigurationHelpers.Load <SerializationConfigurationSection>(SerializationConfigurationSection.SectionName, configFilePath));
        }
Exemplo n.º 7
0
        private static ITaskProcessorClientConfiguration GetClientConfiguration(string configFileName)
        {
            string configFilePath = Path.Combine("Configuration", "Client", configFileName + ".config");

            return(ConfigurationHelpers.Load <ClientConfigurationSection>(ClientConfigurationSection.SectionName, configFilePath));
        }
 /// <inheritdoc />
 public ITaskSchedulerConfiguration GetTaskSchedulerConfiguration()
 {
     return(ConfigurationHelpers.Load <TaskSchedulerConfigurationSection>(TaskSchedulerConfigurationSection.SectionName));
 }
 /// <inheritdoc />
 public ITaskProcessorSerializationConfiguration GetSerializationConfiguration()
 {
     return(ConfigurationHelpers.Load <SerializationConfigurationSection>(SerializationConfigurationSection.SectionName));
 }
 /// <inheritdoc />
 public ITaskProcessorClientConfiguration GetClientConfiguration()
 {
     return(ConfigurationHelpers.Load <ClientConfigurationSection>(ClientConfigurationSection.SectionName));
 }
 /// <inheritdoc />
 public ITaskProcessorConfiguration GetTaskProcessorConfiguration()
 {
     return(ConfigurationHelpers.Load <TaskProcessorConfigurationSection>(TaskProcessorConfigurationSection.SectionName));
 }