当前位置: 首页>>代码示例>>C#>>正文


C# ConfigurationPropertyHolder类代码示例

本文整理汇总了C#中ConfigurationPropertyHolder的典型用法代码示例。如果您正苦于以下问题:C# ConfigurationPropertyHolder类的具体用法?C# ConfigurationPropertyHolder怎么用?C# ConfigurationPropertyHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigurationPropertyHolder类属于命名空间,在下文中一共展示了ConfigurationPropertyHolder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: build_the_container

 public static void build_the_container(ConfigurationPropertyHolder configuration_property_holder)
 {
     Container.initialize_with(null);
     Container.initialize_with(build_items_for_container(configuration_property_holder));
     initialize_file_log_appender();
     set_logging_level_debug_when_debug(configuration_property_holder);
 }
开发者ID:StevenLiekens,项目名称:roundhouse,代码行数:7,代码来源:ApplicationConfiguraton.cs

示例2: RoundhouseRedGateCompareRunner

 public RoundhouseRedGateCompareRunner(KnownFolders known_folders, FileSystemAccess file_system, ConfigurationPropertyHolder configuration, RoundhouseMigrationRunner migration_runner)
 {
     this.known_folders = known_folders;
     this.file_system = file_system;
     this.configuration = configuration;
     this.migration_runner = migration_runner;
 }
开发者ID:Smartrak,项目名称:roundhouse,代码行数:7,代码来源:RoundhouseRedGateCompareRunner.cs

示例3: NHibernateSessionFactoryBuilder

 //private const string proxy_factory = Environment.ProxyFactoryFactoryClass;
 public NHibernateSessionFactoryBuilder(ConfigurationPropertyHolder config)
 {
     configuration_holder = config;
     func_dictionary = new Dictionary<string, Func<IPersistenceConfigurer>>();
     func_dictionary.Add("roundhouse.databases.sqlserver.SqlServerDatabase, roundhouse.databases.sqlserver",
                         () => MsSqlConfiguration.MsSql2005.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.sqlserver2000.SqlServerDatabase, roundhouse.databases.sqlserver2000",
                         () => MsSqlConfiguration.MsSql2000.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.mysql.MySqlDatabase, roundhouse.databases.mysql",
                         () => MySQLConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.oracle.OracleDatabase, roundhouse.databases.oracle",
                         () => OracleClientConfiguration.Oracle9.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.access.AccessDatabase, roundhouse.databases.access",
                         () => JetDriverConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.sqlite.SqliteDatabase, roundhouse.databases.sqlite",
                         () => SQLiteConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.postgresql.PostgreSQLDatabase, roundhouse.databases.postgresql",
                         () => PostgreSQLConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     // merged
     string merged_assembly_name = ApplicationParameters.get_merged_assembly_name();
     func_dictionary.Add("roundhouse.databases.sqlserver.SqlServerDatabase, " + merged_assembly_name,
                         () => MsSqlConfiguration.MsSql2005.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.sqlserver2000.SqlServerDatabase, " + merged_assembly_name,
                         () => MsSqlConfiguration.MsSql2000.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.mysql.MySqlDatabase, " + merged_assembly_name,
                         () => MySQLConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.oracle.OracleDatabase, " + merged_assembly_name,
                         () => OracleClientConfiguration.Oracle9.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.access.AccessDatabase, " + merged_assembly_name,
                         () => JetDriverConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.sqlite.SqliteDatabase, " + merged_assembly_name,
                         () => SQLiteConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
     func_dictionary.Add("roundhouse.databases.postgresql.PostgreSQLDatabase, " + merged_assembly_name,
                         () => PostgreSQLConfiguration.Standard.ConnectionString(configuration_holder.ConnectionString));
 }
开发者ID:nelsestu,项目名称:roundhouse,代码行数:36,代码来源:NHibernateSessionFactoryBuilder.cs

示例4: build

        public static KnownFolders build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            MigrationsFolder alter_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.AlterDatabaseFolderName,false,false);
            MigrationsFolder run_after_create_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.RunAfterCreateDatabaseFolderName,true,false);
            MigrationsFolder up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                     configuration_property_holder.UpFolderName, true, false);
            MigrationsFolder down_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                       configuration_property_holder.DownFolderName, true, false);
            MigrationsFolder run_first_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                            configuration_property_holder.RunFirstAfterUpFolderName, false, false);
            MigrationsFolder functions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                            configuration_property_holder.FunctionsFolderName, false, false);
            MigrationsFolder views_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                        configuration_property_holder.ViewsFolderName, false, false);
            MigrationsFolder sprocs_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.SprocsFolderName, false, false);
            MigrationsFolder indexes_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.IndexesFolderName, false, false);

            MigrationsFolder runAfterOtherAnyTimeScripts_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                         configuration_property_holder.RunAfterOtherAnyTimeScriptsFolderName, false, false);

            MigrationsFolder permissions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory,
                                                                              configuration_property_holder.PermissionsFolderName, false, true);
            Folder change_drop_folder = new DefaultFolder(file_system, combine_items_into_one_path(file_system,
                                                                                                   configuration_property_holder.OutputPath,
                                                                                                   configuration_property_holder.DatabaseName,
                                                                                                   configuration_property_holder.ServerName),
                                                          get_run_date_time_string());

            return new DefaultKnownFolders(alter_database_folder, run_after_create_database_folder,up_folder, down_folder, run_first_folder, functions_folder, views_folder, sprocs_folder, indexes_folder,
                runAfterOtherAnyTimeScripts_folder, permissions_folder, change_drop_folder);
        }
开发者ID:x97mdr,项目名称:roundhouse,代码行数:35,代码来源:KnownFoldersBuilder.cs

示例5: initialize_connections

        public override void initialize_connections(ConfigurationPropertyHolder configuration_property_holder)
        {
            if (!string.IsNullOrEmpty(connection_string))
            {
                string[] parts = connection_string.Split(';');
                foreach (string part in parts)
                {
                    if (string.IsNullOrEmpty(server_name) && (part.to_lower().Contains("server") || part.to_lower().Contains("data source")))
                    {
                        server_name = part.Substring(part.IndexOf("=") + 1);
                    }

                    if (string.IsNullOrEmpty(database_name) && (part.to_lower().Contains("database") || part.to_lower().Contains("database")))
                    {
                        database_name = part.Substring(part.IndexOf("=") + 1);
                    }
                }
            }

            configuration_property_holder.ConnectionString = connection_string;

            set_provider();
            if (string.IsNullOrEmpty(admin_connection_string))
            {
                var builder = new MySqlConnectionStringBuilder(connection_string);
                builder.Database = "information_schema";
                admin_connection_string = builder.ConnectionString;
            }
        }
开发者ID:mjmeintjes,项目名称:roundhouse,代码行数:29,代码来源:MySqlDatabase.cs

示例6: build

        public static KnownFolders build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            MigrationsFolder alter_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.AlterDatabaseFolderName, false, false, "AlterDatabase");
            MigrationsFolder run_after_create_database_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunAfterCreateDatabaseFolderName, true, false, "Run After Create Database");
	        MigrationsFolder run_before_up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunBeforeUpFolderName, false, false, "Run Before Update");
	        MigrationsFolder up_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.UpFolderName, true, false, "Update");
            MigrationsFolder down_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.DownFolderName, true, false, "Down Folder - Nothing to see here. Move along.");
            MigrationsFolder run_first_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunFirstAfterUpFolderName, false, false, "Run First After Update");
            MigrationsFolder functions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.FunctionsFolderName, false, false, "Function");
            MigrationsFolder views_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.ViewsFolderName, false, false, "View");
            MigrationsFolder sprocs_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.SprocsFolderName, false, false, "Stored Procedure");
            MigrationsFolder indexes_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.IndexesFolderName, false, false, "Index");
            MigrationsFolder runAfterOtherAnyTimeScripts_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.RunAfterOtherAnyTimeScriptsFolderName, false, false, "Run after Other Anytime Scripts");
            MigrationsFolder permissions_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.PermissionsFolderName, false, true, "Permission");
            MigrationsFolder before_migration_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.BeforeMigrationFolderName, false, true, "BeforeMigration");
            MigrationsFolder after_migration_folder = new DefaultMigrationsFolder(file_system, configuration_property_holder.SqlFilesDirectory, configuration_property_holder.AfterMigrationFolderName, false, true, "AfterMigration");

            Folder change_drop_folder = new DefaultFolder(file_system, combine_items_into_one_path(file_system,
                                                                                                   configuration_property_holder.OutputPath,
                                                                                                   "migrations",
                                                                                                   remove_paths_from(configuration_property_holder.DatabaseName,file_system),
                                                                                                   remove_paths_from(configuration_property_holder.ServerName,file_system)),
                                                          get_run_date_time_string());

			return new DefaultKnownFolders(alter_database_folder, run_after_create_database_folder, run_before_up_folder, up_folder, down_folder, run_first_folder, functions_folder, views_folder, sprocs_folder, indexes_folder, runAfterOtherAnyTimeScripts_folder, permissions_folder, before_migration_folder, after_migration_folder, change_drop_folder);
        }
开发者ID:Smartrak,项目名称:roundhouse,代码行数:26,代码来源:KnownFoldersBuilder.cs

示例7: RoundhouseMigrationRunner

 public RoundhouseMigrationRunner(
     string repository_path,
     Environment environment,
     KnownFolders known_folders,
     FileSystemAccess file_system,
     DatabaseMigrator database_migrator,
     VersionResolver version_resolver,
     bool silent,
     bool dropping_the_database,
     bool dont_create_the_database,
     bool run_in_a_transaction,
     bool use_simple_recovery,
     ConfigurationPropertyHolder configuration)
 {
     this.known_folders = known_folders;
     this.repository_path = repository_path;
     this.environment = environment;
     this.file_system = file_system;
     this.database_migrator = database_migrator;
     this.version_resolver = version_resolver;
     this.silent = silent;
     this.dropping_the_database = dropping_the_database;
     this.dont_create_the_database = dont_create_the_database;
     this.run_in_a_transaction = run_in_a_transaction;
     this.use_simple_recovery = use_simple_recovery;
     this.configuration = configuration;
 }
开发者ID:jakcharlton,项目名称:roundhouse,代码行数:27,代码来源:RoundhouseMigrationRunner.cs

示例8: replace_tokens

        public static string replace_tokens(ConfigurationPropertyHolder configuration, string text_to_replace)
        {
            if (string.IsNullOrEmpty(text_to_replace)) return string.Empty;

            IDictionary<string, string> dictionary = create_dictionary_from_configuration(configuration);
            Regex regex = new Regex("{{(?<key>\\w+)}}");

            string output = regex.Replace(text_to_replace, m =>
            {
                string key = "";

                try
                {
                    key = m.Groups["key"].Value.to_lower();
                    var value = dictionary[key];
                    return value;
                }
                catch (Exception)
                {
                    throw;
                }
            });

            return output;
        }
开发者ID:binarymash,项目名称:roundhouse,代码行数:25,代码来源:TokenReplacer.cs

示例9: get_diff_runner

 private static RoundhouseRedGateCompareRunner get_diff_runner(ConfigurationPropertyHolder configuration, RoundhouseMigrationRunner migration_runner)
 {
     return new RoundhouseRedGateCompareRunner(
         Container.get_an_instance_of<KnownFolders>(),
         Container.get_an_instance_of<FileSystemAccess>(),
         configuration, migration_runner);
 }
开发者ID:AndersMalmgren,项目名称:roundhouse,代码行数:7,代码来源:Program.cs

示例10: DefaultEnvironmentSet

 public DefaultEnvironmentSet(ConfigurationPropertyHolder configuration_property_holder)
 {
     set_items = configuration_property_holder.EnvironmentNames
         .Split(',')
         .Where(x => !string.IsNullOrWhiteSpace(x))
         .Select(x => new DefaultEnvironment(x.Trim()))
         .ToList();
 }
开发者ID:Smartrak,项目名称:roundhouse,代码行数:8,代码来源:DefaultEnvironmentSet.cs

示例11: build

        public static VersionResolver build(FileSystemAccess file_system, ConfigurationPropertyHolder configuration_property_holder)
        {
            VersionResolver xml_version_finder = new XmlFileVersionResolver(file_system, configuration_property_holder.VersionXPath, configuration_property_holder.VersionFile);
            VersionResolver dll_version_finder = new DllFileVersionResolver(file_system, configuration_property_holder.VersionFile);
            VersionResolver script_number_version_finder = new ScriptfileVersionResolver(file_system, configuration_property_holder);

            IEnumerable<VersionResolver> resolvers = new List<VersionResolver> { xml_version_finder, dll_version_finder, script_number_version_finder };

            return new ComplexVersionResolver(resolvers);
        }
开发者ID:richardpascual,项目名称:roundhouse,代码行数:10,代码来源:VersionResolverBuilder.cs

示例12: create_dictionary_from_configuration

        private static IDictionary<string, string> create_dictionary_from_configuration(ConfigurationPropertyHolder configuration)
        {
            Dictionary<string, string> property_dictionary = new Dictionary<string, string>();
            foreach (var property in configuration.GetType().GetProperties())
            {
                property_dictionary.Add(property.Name.to_lower(), property.GetValue(configuration, null).to_string());
            }

            return property_dictionary;
        }
开发者ID:binarymash,项目名称:roundhouse,代码行数:10,代码来源:TokenReplacer.cs

示例13: MSBuildLogger

        public MSBuildLogger(ConfigurationPropertyHolder configuration)
        {
            var task = configuration as ITask;
            if (task != null)
            {
                build_engine = task.BuildEngine;
            }

            calling_task = configuration;
        }
开发者ID:Smartrak,项目名称:roundhouse,代码行数:10,代码来源:MSBuildLogger.cs

示例14: initialize_connections

        public override void initialize_connections(ConfigurationPropertyHolder configuration_property_holder)
        {
            if (!string.IsNullOrEmpty(connection_string))
            {
                string[] parts = connection_string.Split(';');
                foreach (string part in parts)
                {
                    if (string.IsNullOrEmpty(server_name) && (part.to_lower().Contains("server") || part.to_lower().Contains("data source")))
                    {
                        server_name = part.Substring(part.IndexOf("=") + 1);
                    }

                    if (string.IsNullOrEmpty(database_name) && (part.to_lower().Contains("initial catalog") || part.to_lower().Contains("database")))
                    {
                        database_name = part.Substring(part.IndexOf("=") + 1);
                    }
                }

                if (!connection_string.to_lower().Contains(connect_options.to_lower()))
                {
                    connect_options = string.Empty;
                    foreach (string part in parts)
                    {
                        if (!part.to_lower().Contains("server") && !part.to_lower().Contains("data source") && !part.to_lower().Contains("initial catalog") &&
                            !part.to_lower().Contains("database"))
                        {
                            connect_options += part + ";";
                        }
                    }
                }
            }


            if (connect_options == "Integrated Security")
            {
                connect_options = "Integrated Security=SSPI;";
            }

            if (string.IsNullOrEmpty(connection_string))
            {
                connection_string = build_connection_string(server_name, database_name, connect_options);
            }

            configuration_property_holder.ConnectionString = connection_string;

            set_provider();
            if (string.IsNullOrEmpty(admin_connection_string))
            {
                admin_connection_string = Regex.Replace(connection_string, "initial catalog=.*?;", "initial catalog=master;", RegexOptions.IgnoreCase);
                admin_connection_string = Regex.Replace(admin_connection_string, "database=.*?;", "database=master;", RegexOptions.IgnoreCase);
            }
            configuration_property_holder.ConnectionStringAdmin = admin_connection_string;

            //set_repository(configuration_property_holder);
        }
开发者ID:Smartrak,项目名称:roundhouse,代码行数:55,代码来源:SqlServerDatabase.cs

示例15: run_migrator

        public static void run_migrator(ConfigurationPropertyHolder configuration)
        {
            RoundhouseMigrationRunner migration_runner = get_migration_runner(configuration);
            migration_runner.run();

            if (!configuration.Silent)
            {
                Console.WriteLine("{0}Please press enter to continue...", Environment.NewLine);
                Console.Read();
            }
        }
开发者ID:AndersMalmgren,项目名称:roundhouse,代码行数:11,代码来源:Program.cs


注:本文中的ConfigurationPropertyHolder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。