コード例 #1
0
 /// <summary>
 /// Opens the instrumenation section, builds the design time nodes and adds them to the application node.
 /// </summary>
 /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
 /// <param name="rootNode">The root node of the application.</param>
 /// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
 protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
 {
     if (null != section)
     {
         rootNode.AddNode(new InstrumentationNode((InstrumentationConfigurationSection)section));
     }
 }
コード例 #2
0
		/// <summary>
		/// Opens the security settings configuration section, builds the design time nodes and adds them to the application node.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		/// <param name="rootNode">The root node of the application.</param>
		/// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
		protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
		{
			if (null != section)
            {
				rootNode.AddNode(new SecuritySettingsNodeBuilder(serviceProvider, (SecuritySettings)section).Build());
			}
		}
		/// <summary>
		/// Opens the instrumenation section, builds the design time nodes and adds them to the application node.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		/// <param name="rootNode">The root node of the application.</param>
		/// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
		protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
		{
			if (null != section)
			{				
				rootNode.AddNode(new InstrumentationNode((InstrumentationConfigurationSection)section));
			}				
		}
コード例 #4
0
		/// <summary>
		/// Opens the caching configuration from an application configuration file.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		/// <param name="rootNode">The <see cref="ConfigurationApplicationNode"/> of the hierarchy.</param>
		/// <param name="section">The caching configuration section or null if no section was found.</param>
		protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
		{
			if (null != section)
			{
				CacheManagerSettingsNodeBuilder builder = new CacheManagerSettingsNodeBuilder(serviceProvider, (CacheManagerSettings)section);
				rootNode.AddNode(builder.Build());
			}
		}
		/// <summary>
		/// Opens the exception handling settings configuration section, builds the design time nodes and adds them to the application node.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		/// <param name="rootNode">The root node of the application.</param>
		/// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
		protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
		{
			if (null != section)
			{
				ExceptionHandlingSettingsNodeBuilder builder = new ExceptionHandlingSettingsNodeBuilder(serviceProvider, (ExceptionHandlingSettings)section);
				rootNode.AddNode(builder.Build());
			}
		}
		/// <summary>
		/// Opens the configuration sources section, builds the design time nodes and adds them to the application node.
		/// </summary>
		/// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
		/// <param name="rootNode">The root node of the application.</param>
		/// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
		protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
		{			
			if (null != section)
			{
				ConfigurationSourceSectionNodeBuilder builder = new ConfigurationSourceSectionNodeBuilder(serviceProvider, (ConfigurationSourceSection)section);
				rootNode.AddNode(builder.Build());
			}				
		}
コード例 #7
0
 /// <summary>
 /// Opens the configuration sources section, builds the design time nodes and adds them to the application node.
 /// </summary>
 /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
 /// <param name="rootNode">The root node of the application.</param>
 /// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="IConfigurationSource"/>.</param>
 protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
 {
     if (null != section)
     {
         ConfigurationSourceSectionNodeBuilder builder = new ConfigurationSourceSectionNodeBuilder(serviceProvider, (ConfigurationSourceSection)section);
         rootNode.AddNode(builder.Build());
     }
 }
コード例 #8
0
        public void FindTypeNodeInHierarchy()
        {
            ConfigurationApplicationFile applicationData = ConfigurationApplicationFile.FromCurrentAppDomain();
            ConfigurationApplicationNode applicationNode = new ConfigurationApplicationNode(applicationData);
			IConfigurationUIHierarchy hierarchy = new ConfigurationUIHierarchy(applicationNode, ServiceBuilder.Build());
            MyConfigNode configNode = new MyConfigNode("MyBlock");
            applicationNode.AddNode(configNode);
            ConfigurationNode node = (ConfigurationNode)hierarchy.FindNodeByType(typeof(MyConfigNode));
            
            Assert.IsNotNull(node);
            Assert.AreSame(configNode, node);
        }
コード例 #9
0
        /// <summary>
        /// Sets up the design time objects to represent the configuration for the validation block.
        /// </summary>
        /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
        /// <param name="rootNode">The root node of the application.</param>
        /// <param name="section">The <see cref="ConfigurationSection"/> that was opened from the <see cref="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.IConfigurationSource"/>.</param>
        protected override void OpenCore(IServiceProvider serviceProvider, 
            ConfigurationApplicationNode rootNode,
            ConfigurationSection section)
        {
            if (null != section)
            {
                ValidationSettingsNodeBuilder builder = new ValidationSettingsNodeBuilder(serviceProvider, (ValidationSettings)section);
                ValidationSettingsNode node = builder.Build();

                SetProtectionProvider(section, node);
                rootNode.AddNode(node);
            }
        }
 protected override void OpenCore(IServiceProvider serviceProvider, ConfigurationApplicationNode rootNode, ConfigurationSection section)
 {
     rootNode.AddNode(new EnvironmentalOverridesNode());
 }