view Source/Configuration/BLToolkitSection.cs @ 7:99cd4f3947d8

Закомментированы строки мешающие добавлению авиа дежурств.
author nickolay
date Fri, 27 Oct 2017 18:26:29 +0300
parents f990fcb411a9
children
line wrap: on
line source

using System;
using System.Configuration;
using System.Security;

namespace BLToolkit.Configuration
{
	/// <summary>
	/// Implementation of custom configuration section.
	/// </summary>
	internal class BLToolkitSection : ConfigurationSection
	{
		private const string SectionName = "bltoolkit";
		private static readonly ConfigurationPropertyCollection _properties =
			new ConfigurationPropertyCollection();

		private static readonly ConfigurationProperty           _propDataProviders = 
			new ConfigurationProperty("dataProviders",           typeof(DataProviderElementCollection),
			new DataProviderElementCollection(),                 ConfigurationPropertyOptions.None);
		private static readonly ConfigurationProperty           _propDefaultConfiguration =
			new ConfigurationProperty("defaultConfiguration",    typeof(string),
			null,                                                ConfigurationPropertyOptions.None);
		private static readonly ConfigurationProperty           _propTypeFactory =
			new ConfigurationProperty("typeFactory",             typeof(TypeFactoryElement),
			null,                                                ConfigurationPropertyOptions.None);

		static BLToolkitSection()
		{
			_properties.Add(_propDataProviders);
			_properties.Add(_propDefaultConfiguration);
			_properties.Add(_propTypeFactory);
		}

		public static BLToolkitSection Instance
		{
			get
			{
				try
				{
					return (BLToolkitSection)ConfigurationManager.GetSection(SectionName);
				}
				catch (SecurityException)
				{
					return null;
				}
			}
		}

		protected override ConfigurationPropertyCollection Properties
		{
			get { return _properties; }
		}

		public DataProviderElementCollection DataProviders
		{
			get { return (DataProviderElementCollection) base[_propDataProviders]; }
		}

		public string DefaultConfiguration
		{
			get { return (string)base[_propDefaultConfiguration]; }
		}

		public TypeFactoryElement TypeFactory
		{
			get { return (TypeFactoryElement)base[_propTypeFactory]; }
		}
	}
}