Ejemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            Configuration config             = ConfigurationManager.OpenExeConfiguration(null);
            DatabaseInformationSection dbSec = (DatabaseInformationSection)config.GetSection(CONFIGURATION_SECTION_PATH_DATABASE);

            EnvironmentHolder.Initialize(dbSec);
        }
        public static void Initialize(DatabaseInformationSection dbInfoSection)
        {
            lock (lockerForInitialization)
            {
                if (initialized)
                {
                    throw SharedExceptionGenerator.CreateModuleAlreadyInitializedException(typeof(EnvironmentHolder).Assembly.GetName().Name);
                }
                if (dbInfoSection == null)
                {
                    throw new ArgumentNullException("dbInfoSection");
                }

                _dbInfoSection = dbInfoSection;

                initialized = true;
            }
        }