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


C# Configuration.DatabaseSection类代码示例

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


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


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