| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /*******************************************************************************
- * Copyright(c) 2014 DongkeSoft All rights reserved. / Confidential
- * 类的信息:
- * 1.程序名称:BatchingHostingSettings.cs
- * 2.功能描述:配置文件信息
- * 编辑履历:
- * 作者 日期 版本 修改内容
- * 陈晓野 2014/09/16 1.00 新建
- *******************************************************************************/
- using System;
- using System.ComponentModel;
- using System.Configuration;
- namespace Dongke.IBOSS.PRD.WCF.Services.ConfigSetting
- {
- /// <summary>
- /// 表示配置文件中的节
- /// </summary>
- public class BatchingHostingSettings : ConfigurationSection
- {
- [ConfigurationProperty("", IsDefaultCollection = true)]
- public ServiceTypeElementCollection ServiceTypes
- {
- get
- {
- return (ServiceTypeElementCollection)this[""];
- }
- }
- public static BatchingHostingSettings GetSection()
- {
- return ConfigurationManager.GetSection("dongke.batchingHosting") as BatchingHostingSettings;
- }
- }
- /// <summary>
- /// 表示包含一个子元素集合的配置元素
- /// </summary>
- public class ServiceTypeElementCollection : ConfigurationElementCollection
- {
- protected override ConfigurationElement CreateNewElement()
- {
- return new ServiceTypeElement();
- }
- protected override object GetElementKey(ConfigurationElement element)
- {
- ServiceTypeElement serviceTypeElement = (ServiceTypeElement)element;
- return serviceTypeElement.ServiceType.MetadataToken;
- }
- }
- /// <summary>
- /// 表示配置文件中的配置元素
- /// </summary>
- public class ServiceTypeElement : ConfigurationElement
- {
- [ConfigurationProperty("type", IsRequired = true)]
- [TypeConverter(typeof(AssemblyQualifiedTypeNameConverter))]
- public Type ServiceType
- {
- get
- {
- return (Type)this["type"];
- }
- set
- {
- this["type"] = value;
- }
- }
- }
- }
|