コード例 #1
0
ファイル: MainFactory.cs プロジェクト: tah182/Comet
        /// <summary>
        /// Returns the Configuration managed by the configuration xml in app_data
        /// </summary>
        /// <returns>The Configuration for the runtime environment</returns>
        public static Configuration getConfiguration()
        {
            string hostName = HttpContext.Current.Request.Url.Host.ToLower();

            Configuration config = new Configuration();
            //#warning Host Application Database connection strings are modified.
            if (hostName.ToLower().StartsWith("comet-test") || hostName.StartsWith("localho")) {
                config.add("application", "Comet-test");
                config.addDatabase(TEST_CONN_STRING);
            } else {
                config.add("application", "Comet");
                config.addDatabase(PROD_CONN_STRING);
            }

            return config;
        }