Esempio n. 1
0
        public static DaIdentityConfigurationSection GetConfiguration(string configurationName)
        {
            var config = DaGlobalApplicationContext.GetConfiguration <DaIdentityConfigurationSection>(configurationName);

            if (config == null)
            {
                config = new DaIdentityConfigurationSection();
            }

            return(config);
        }
        /// <summary>
        /// Loads data configuration into <see cref="DaGlobalApplicationContext"/> from the given configuration source.
        /// </summary>
        /// <param name="configurationSource">The configuration source from which configuration to load.</param>
        /// <param name="configurationName">The name of the configuration.</param>
        public static void InitConfiguration(string configurationName, IDaConfigurationSource configurationSource)
        {
            if (configurationSource == null)
            {
                throw new ArgumentNullException(nameof(configurationSource));
            }

            _configurationSource = configurationSource;

            DaGlobalApplicationContext.LoadConfiguration <DaDataConfigurationSection>(configurationName, configurationSource);
        }
        /// <summary>
        /// Creates an instance of <see cref="DaSmsProviderBase"/>.
        /// </summary>
        public DaSmsProviderBase()
        {
            var config   = DaGlobalApplicationContext.GetConfiguration <DaSmsConfigurationSection>("daSmsConfiguration");
            var provider = config.Providers.GetByName(config.DefaultProvider);

            SmsProviderInfo = new DaSmsProviderInfo()
            {
                From  = provider.From,
                Sid   = provider.Sid,
                Token = provider.Token
            };
        }
        /// <summary>
        /// Gets data configuration from <see cref="DaGlobalApplicationContext"/>.
        /// </summary>
        /// <param name="configurationName">The name of the configuration.</param>
        /// <returns>Returns an instance of the <see cref="DaDataConfigurationSection"/> configuration.</returns>
        public static DaDataConfigurationSection GetConfiguration(string configurationName)
        {
            var config = DaGlobalApplicationContext.GetConfiguration <DaDataConfigurationSection>(configurationName);

            if (config == null)
            {
                config = new DaDataConfigurationSection();
                config.DbConnection = "daDbConnection";
            }

            return(config);
        }
        /// <summary>
        /// Gets exception handling configuration from <see cref="DaGlobalApplicationContext"/>.
        /// </summary>
        /// <param name="configurationName">The name of the configuration.</param>
        /// <returns>Returns an instance of the <see cref="DaExceptionHandlingConfigurationSection"/> configuration.</returns>
        public static DaExceptionHandlingConfigurationSection GetConfiguration(string configurationName)
        {
            var config = DaGlobalApplicationContext.GetConfiguration <DaExceptionHandlingConfigurationSection>(configurationName);

            if (config == null)
            {
                config = new DaExceptionHandlingConfigurationSection();
                config.Providers.Add(new DaProviderConfigurationElement()
                {
                    Name = "defaultExceptionManager",
                    Type = "Ejyle.DevAccelerate.Core.Exceptions.DefaultExceptionManager, DevAccelerate.Core"
                });

                config.DefaultProvider = "defaultExceptionManager";
            }

            return(config);
        }
Esempio n. 6
0
 public static DaAppsConfigurationSection GetConfiguration(string configurationName)
 {
     return(DaGlobalApplicationContext.GetConfiguration <DaAppsConfigurationSection>(configurationName));
 }
Esempio n. 7
0
 public static void InitConfiguration(string configurationName, IDaConfigurationSource configurationSource)
 {
     DaGlobalApplicationContext.LoadConfiguration <DaAppsConfigurationSection>(configurationName, configurationSource);
 }
 public static DaEnterpriseSecurityConfigurationSection GetConfiguration(string configurationName)
 {
     return(DaGlobalApplicationContext.GetConfiguration <DaEnterpriseSecurityConfigurationSection>(configurationName));
 }