• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Configuration.DatabaseSection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: IndexerServer

        public IndexerServer(DatabaseSection config)
        {
            if (config == null)
                config = new DatabaseSection();

            Init(config.Search.Server.UrlPrefix, config.Search.Server.SharedSecret, config.Search.IndexPath);
        }
开发者ID:nicklv,项目名称:n2cms,代码行数:7,代码来源:IndexerServer.cs


示例2: SessionProvider

		public SessionProvider(IConfigurationBuilder builder, NHInterceptorFactory interceptorFactory, IWebContext webContext, DatabaseSection config)
		{
			nhSessionFactory = builder.BuildSessionFactory();
			this.webContext = webContext;
			this.interceptorFactory = interceptorFactory;
			this.isolation = config.Isolation;
		}
开发者ID:navneetccna,项目名称:n2cms,代码行数:7,代码来源:SessionProvider.cs


示例3: SearchConfigurationBuilderParticipator

 public SearchConfigurationBuilderParticipator(IWebContext webContext, DatabaseSection config)
 {
     this.webContext = webContext;
     searchEnabled = config.Search.Enabled;
     asyncIndexing = config.Search.AsyncIndexing;
     indexPath = config.Search.IndexPath;
 }
开发者ID:joaohortencio,项目名称:n2cms,代码行数:7,代码来源:SearchConfigurationBuilderParticipator.cs


示例4: IndexerClient

		public IndexerClient(DatabaseSection config)
		{
			serverUrl = config.Search.Client.Url;
			timeout = config.Search.Client.IndexTimeout;
			sharedSecret = config.Search.Client.SharedSecret;
			instanceName = config.Search.Client.InstanceName;
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:7,代码来源:IndexerClient.cs


示例5: ContentChangeTracker

        public ContentChangeTracker(IAsyncIndexer indexer, IPersister persister, ConnectionMonitor connection, DatabaseSection config)
        {
            this.indexer = indexer;

            if (!config.Search.Enabled)
                return;
            if (!string.IsNullOrEmpty(config.Search.IndexOnMachineNamed) && config.Search.IndexOnMachineNamed != Environment.MachineName)
                return;

            connection.Online += delegate
            {
                IsMonitoring = true;
                persister.ItemSaved += persister_ItemSaved;
                persister.ItemMoving += persister_ItemMoving;
                persister.ItemMoved += persister_ItemMoved;
                persister.ItemCopied += persister_ItemCopied;
                persister.ItemDeleted += persister_ItemDeleted;
            };
            connection.Offline += delegate
            {
                IsMonitoring = false;
                persister.ItemSaved -= persister_ItemSaved;
                persister.ItemMoving -= persister_ItemMoving;
                persister.ItemMoved -= persister_ItemMoved;
                persister.ItemCopied -= persister_ItemCopied;
                persister.ItemDeleted -= persister_ItemDeleted;
            };
        }
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:28,代码来源:ContentChangeTracker.cs


示例6: DiagnosticController

        public DiagnosticController(IContentItemRepository repository, IHost host, IDefinitionManager definitions,
            ILinkGenerator linkGenerator, IUrlParser parser, DatabaseSection config, IFlushable flushable, IReplicationStorage repstore, 
            IFileSystemFactory fileSystemFactory)
        {
            _repository = repository;
            _host = host;
            _definitions = definitions;
            _linkGenerator = linkGenerator;
            _parser = parser;
            _flushable = flushable;
            _tablePrefix = config.TablePrefix;

            _repstore = repstore;

            if (_forceWriteLockManager != null) return;

            // Create Force Write Lock Manager
            var storageConfig = (FileSystemNamespace) Enum.Parse(typeof (FileSystemNamespace),
                ConfigurationManager.AppSettings["AzureReplicationStorageContainerName"] ??
                "ReplicationStorageDebug");

            var fileSystem = fileSystemFactory.Create(storageConfig);
            _forceWriteLockManager = new ReplicationForceWriteLockManager(fileSystem);
            _writeLockManager = new ReplicationWriteLockManager(fileSystem);
        }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:25,代码来源:DiagnosticController.cs


示例7: SetupMappings

		private void SetupMappings(DatabaseSection config)
		{
			foreach (MappingElement me in config.Mappings)
			{
				mappingNames.Add(me.Name);
			}
		}
开发者ID:nagarjunachallapalli,项目名称:n2cms,代码行数:7,代码来源:ConfigurationBuilder.cs


示例8: ContentChangeTracker

        public ContentChangeTracker(IIndexer indexer, IPersister persister, IWorker worker, ConnectionMonitor connection, IErrorNotifier errors, DatabaseSection config)
        {
            this.indexer = indexer;
            this.persister = persister;
            this.worker = worker;
            this.errors = errors;
            this.async = config.Search.AsyncIndexing;
            this.handleErrors = config.Search.HandleErrors;

            RetryInterval = TimeSpan.FromMinutes(2);

            if(config.Search.Enabled)
            {
                connection.Online += delegate
                {
                    persister.ItemSaved += persister_ItemSaved;
                    persister.ItemMoving += persister_ItemMoving;
                    persister.ItemMoved += persister_ItemMoved;
                    persister.ItemCopied += persister_ItemCopied;
                    persister.ItemDeleted += persister_ItemDeleted;
                };
                connection.Offline += delegate
                {
                    persister.ItemSaved -= persister_ItemSaved;
                    persister.ItemMoving -= persister_ItemMoving;
                    persister.ItemMoved -= persister_ItemMoved;
                    persister.ItemCopied -= persister_ItemCopied;
                    persister.ItemDeleted -= persister_ItemDeleted;
                };
            }
        }
开发者ID:Jobu,项目名称:n2cms,代码行数:31,代码来源:ContentChangeTracker.cs


示例9: SetupProperties

		/// <summary>Sets properties configuration dictionary based on configuration in the database section.</summary>
		/// <param name="config">The database section configuration.</param>
		/// <param name="connectionStrings">Connection strings from configuration</param>
		protected void SetupProperties(DatabaseSection config, ConnectionStringsSection connectionStrings)
		{
			NHibernate.Cfg.Environment.UseReflectionOptimizer = Utility.GetTrustLevel() > System.Web.AspNetHostingPermissionLevel.Medium;

			// connection

			Properties[NHibernate.Cfg.Environment.ConnectionStringName] = config.ConnectionStringName;
			Properties[NHibernate.Cfg.Environment.ConnectionProvider] = "NHibernate.Connection.DriverConnectionProvider";
			Properties[NHibernate.Cfg.Environment.Hbm2ddlKeyWords] = "none";

			SetupFlavourProperties(config, connectionStrings);

			bool useNonBatcher = 
				// configured batch size <= 1
				(batchSize.HasValue && batchSize.Value <= 1)
				// medium trust in combination with sql client driver 
				// causes fault: Attempt by method 'NHibernate.AdoNet.SqlClientSqlCommandSet..ctor()' to access method 'System.Data.SqlClient.SqlCommandSet..ctor()' failed.   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
				|| (Utility.GetTrustLevel() <= System.Web.AspNetHostingPermissionLevel.Medium && typeof(SqlClientDriver).IsAssignableFrom(Type.GetType(Properties[Environment.ConnectionDriver])));
			if (useNonBatcher)
				Properties[NHibernate.Cfg.Environment.BatchStrategy] = typeof(NonBatchingBatcherFactory).AssemblyQualifiedName;

			SetupCacheProperties(config);

			if (config.Isolation.HasValue)
				Properties[NHibernate.Cfg.Environment.Isolation] = config.Isolation.ToString();

			foreach (string key in config.HibernateProperties.AllKeys)
			{
				Properties[key] = config.HibernateProperties[key].Value;
			}
		}
开发者ID:nagarjunachallapalli,项目名称:n2cms,代码行数:34,代码来源:ConfigurationBuilder.cs


示例10: SessionProvider

		public SessionProvider(IConfigurationBuilder builder, NHInterceptorFactory interceptorFactory, IWebContext webContext, DatabaseSection config)
		{
			nhSessionFactory = builder.BuildSessionFactory();
			this.webContext = webContext;
			this.interceptorFactory = interceptorFactory;
			this.isolation = config.Isolation;
			this.autoStartTransaction = config.AutoStartTransaction;
			this.CacheEnabled = config.Caching;
		}
开发者ID:rohancragg,项目名称:n2cms,代码行数:9,代码来源:SessionProvider.cs


示例11: AsyncIndexer

        public AsyncIndexer(IContentIndexer indexer, IPersister persister, IWorker worker, IErrorNotifier errors, DatabaseSection config)
        {
            RetryInterval = TimeSpan.FromMinutes(2);
            this.async = config.Search.AsyncIndexing;
            this.handleErrors = config.Search.HandleErrors;

            this.indexer = indexer;
            this.persister = persister;
            this.worker = worker;
            this.errors = errors;
        }
开发者ID:brianmatic,项目名称:n2cms,代码行数:11,代码来源:AsyncIndexer.cs


示例12: AzureFileSystem

        public AzureFileSystem(ISessionProvider sessionProvider, DatabaseSection config)
        {
            var storageAccount = CloudStorageAccount.Parse(
                ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);

            this.container = storageAccount.CreateCloudBlobClient().GetContainerReference("le-upload");

            container.CreateIfNotExists();
            container.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Container });

            CreateDirectory("/upload/");
        }
开发者ID:philipnilsson,项目名称:N2AzureFileSystem,代码行数:12,代码来源:AzureFileSystem.cs


示例13: ReplicationManager

 public ReplicationManager(
     IPersister persister,
     IItemFinder finder,
     IReplicationStorage repstore,
     IFileSystemFactory fileSystemFactory,
     DatabaseSection dataBaseSection,
     ISecurityManager security
 )
     : this(persister, finder, repstore, fileSystemFactory, dataBaseSection, security, null, null)
 {
     // needed to be able to execute N2 unit tests w/o additional dependecies
 }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:12,代码来源:ReplicationManager.cs


示例14: InstallationManager

		public InstallationManager(IHost host, DefinitionMap map, ContentActivator activator, Importer importer, IPersister persister, ISessionProvider sessionProvider, IConfigurationBuilder configurationBuilder, IWebContext webContext, ConnectionMonitor connectionContext, DatabaseSection config)
		{
			this.host = host;
			this.map = map;
			this.activator = activator;
			this.importer = importer;
			this.persister = persister;
			this.sessionProvider = sessionProvider;
			this.configurationBuilder = configurationBuilder;
			this.webContext = webContext;
			this.connectionContext = connectionContext;
			this.isDatabaseFileSystemEnbled = config.Files.StorageLocation == FileStoreLocation.Database;
		}
开发者ID:rohancragg,项目名称:n2cms,代码行数:13,代码来源:InstallationManager.cs


示例15: ConfigurationBuilder

        /// <summary>Creates a new instance of the <see cref="ConfigurationBuilder"/>.</summary>
        public ConfigurationBuilder(IDefinitionProvider[] definitionProviders, ClassMappingGenerator generator, IWebContext webContext, ConfigurationBuilderParticipator[] participators, DatabaseSection config, ConnectionStringsSection connectionStrings)
        {
            this.definitionProviders = definitionProviders;
            this.generator = generator;
            this.webContext = webContext;
            this.participators = participators;

            if (config == null) config = new DatabaseSection();
            TryLocatingHbmResources = config.TryLocatingHbmResources;
            tablePrefix = config.TablePrefix;
            batchSize = config.BatchSize;
            childrenLaziness = config.ChildrenLaziness;

            SetupProperties(config, connectionStrings);
            SetupMappings(config);
        }
开发者ID:ikvm,项目名称:n2cms,代码行数:17,代码来源:ConfigurationBuilder.cs


示例16: ConfigurationBuilder

        /// <summary>Creates a new instance of the <see cref="ConfigurationBuilder"/>.</summary>
        public ConfigurationBuilder(IDefinitionManager definitions, ClassMappingGenerator generator, DatabaseSection config, ConnectionStringsSection connectionStrings)
        {
            this.definitions = definitions;
            this.generator = generator;

            if (config == null) config = new DatabaseSection();

            if (!string.IsNullOrEmpty(config.HibernateMapping))
                DefaultMapping = config.HibernateMapping;

            SetupProperties(config, connectionStrings);
            SetupMappings(config);

            TryLocatingHbmResources = config.TryLocatingHbmResources;
            tablePrefix = config.TablePrefix;
            batchSize = config.BatchSize;
            childrenLaziness = config.ChildrenLaziness;
        }
开发者ID:spmason,项目名称:n2cms,代码行数:19,代码来源:ConfigurationBuilder.cs


示例17: ContentChangeTracker

        public ContentChangeTracker(IAsyncIndexer indexer, IPersister persister, ConnectionMonitor connection, DatabaseSection config)
        {
            this.indexer = indexer;

            if(config.Search.Enabled)
            {
                connection.Online += delegate
                {
                    persister.ItemSaved += persister_ItemSaved;
                    persister.ItemMoving += persister_ItemMoving;
                    persister.ItemMoved += persister_ItemMoved;
                    persister.ItemCopied += persister_ItemCopied;
                    persister.ItemDeleted += persister_ItemDeleted;
                };
                connection.Offline += delegate
                {
                    persister.ItemSaved -= persister_ItemSaved;
                    persister.ItemMoving -= persister_ItemMoving;
                    persister.ItemMoved -= persister_ItemMoved;
                    persister.ItemCopied -= persister_ItemCopied;
                    persister.ItemDeleted -= persister_ItemDeleted;
                };
            }
        }
开发者ID:GrimaceOfDespair,项目名称:n2cms,代码行数:24,代码来源:ContentChangeTracker.cs


示例18: FileConfigurationParticipator

 public FileConfigurationParticipator(DatabaseSection config)
 {
     tablePrefix = config.TablePrefix;
     chunkSize = config.Files.ChunkSize;
 }
开发者ID:GrimaceOfDespair,项目名称:n2cms,代码行数:5,代码来源:FileConfigurationParticipator.cs


示例19: RavenStoreFactory

		public RavenStoreFactory(DatabaseSection config)
		{
			connectionStringName = config.ConnectionStringName;
			RunInMemory = config.Raven.RunInMemory;
			EmbeddedDocumentStore = config.Raven.EmbeddedDocumentStore;
		}
开发者ID:n2cms,项目名称:n2cms,代码行数:6,代码来源:RavenStoreFactory.cs


示例20: SetupCacheProperties

		private void SetupCacheProperties(DatabaseSection config)
		{
			Properties[NHibernate.Cfg.Environment.UseSecondLevelCache] = config.Caching.ToString();
			Properties[NHibernate.Cfg.Environment.UseQueryCache] = config.Caching.ToString();
			Properties[NHibernate.Cfg.Environment.CacheProvider] = config.CacheProviderClass;
		}
开发者ID:nagarjunachallapalli,项目名称:n2cms,代码行数:6,代码来源:ConfigurationBuilder.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Installation.DatabaseStatus类代码示例发布时间:2022-05-26
下一篇:
C# MyssClassicDAL.DB类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap