首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏.NET开发那点事

    .NET 配置文件简单使用

    方法2: 继承ConfigurationSection类,配合ConfigurationProperty特性来实现 public class ObjectContainerElement : ConfigurationElement { [ConfigurationProperty("provider", IsRequired = true)] public string Provider set { this["provider"] = (object)value; } } [ConfigurationProperty /// public class AgileFRConfigurationHandler : ConfigurationSection { [ConfigurationProperty

    90390发布于 2018-01-04
  • 来自专栏技术博客

    App.config和Web.config配置文件的自定义配置节点

    ] ,ConfigurationProperty的构造函数中传入的name字符串将会用于config文件中,表示各参数的属性名称。 实现代码如下: namespace Demo { public class Section1 : ConfigurationSection { [ConfigurationProperty null) writer.WriteCData(CommandText); return true; } [ConfigurationProperty 在创建ConfigurationSection的继承类时,创建一个表示集合的属性就可以了,注意[ConfigurationProperty]的各参数。 get { return this["key"].ToString(); } set { this["key"] = value; } } [ConfigurationProperty

    1.7K30发布于 2018-08-31
  • 来自专栏大内老A

    Enterprise Library深入解析与灵活应用(5):创建一个简易版的批处理执行器,认识Enterprise Library典型的配置方式和对象创建方式

    ExecutableFileJobStepAssmbler))] public class ExecutableJobStepData : JobStepData { [ConfigurationProperty return this["arguments"] as NamedElementCollection<ArgumentEntry>; } } [ConfigurationProperty return this["variables"] as NamedElementCollection<VariableEntry>; } } [ConfigurationProperty return this["batchJobs"] as NamedElementCollection<BatchJobEntry>; } } [ConfigurationProperty { return this["description"] as string; } } [ConfigurationProperty

    787100发布于 2018-01-16
  • 来自专栏大内老A

    使命必达: 深入剖析WCF的可靠会话[编程篇](下)

    1: public sealed class ReliableSessionElement : BindingElementExtensionElement 2: { 3: [ConfigurationProperty AcknowledgementInterval { get; set; } 5: public override Type BindingElementType { get; } 6: [ConfigurationProperty TimeSpan InactivityTimeout { get; set; } 10: [IntegerValidator(MinValue=1, MaxValue=0x4000), ConfigurationProperty =4)] 11: public int MaxPendingChannels { get; set; } 12: [IntegerValidator(MinValue=1), ConfigurationProperty ("maxRetryCount", DefaultValue=8)] 13: public int MaxRetryCount { get; set; } 14: [ConfigurationProperty

    76980发布于 2018-02-07
  • 来自专栏.Net Core技术分享

    创建自定义配置节点(web.config和app.config都适用)

    return (string)this["fileName"]; } set { this["fileName"] = value; } } [ConfigurationProperty return (long)this["maxUsers"]; } set { this["maxUsers"] = value; } } [ConfigurationProperty (TimeSpan)this["maxIdleTime"]; } set { this["maxIdleTime"] = value; } } } } ConfigurationProperty 对于每一个标记有此特性的属性,.NET Framework 都使用反射来读取修饰参数,并创建相关的 ConfigurationProperty 实例。 title { get { return (string)base["title"]; } set { title = value; } } //subTitle属性 [ConfigurationProperty

    1.6K20发布于 2019-09-26
  • 来自专栏大内老A

    Enterprise Library深入解析与灵活应用(5):创建一个简易版的批处理执行器,认识Enterprise Library典型的配置方式和对象创建方式

    ExecutableFileJobStepAssmbler))] public class ExecutableJobStepData : JobStepData { [ConfigurationProperty return this["arguments"] as NamedElementCollection<ArgumentEntry>; } } [ConfigurationProperty return this["variables"] as NamedElementCollection<VariableEntry>; } } [ConfigurationProperty return this["batchJobs"] as NamedElementCollection<BatchJobEntry>; } } [ConfigurationProperty { return this["description"] as string; } } [ConfigurationProperty

    754110发布于 2018-01-16
  • 来自专栏技术博客

    App.config和Web.config配置文件的自定义配置节点

    ] ,ConfigurationProperty的构造函数中传入的name字符串将会用于config文件中,表示各参数的属性名称。 实现代码如下: namespace Demo { public class Section1 : ConfigurationSection { [ConfigurationProperty null) writer.WriteCData(CommandText); return true; } [ConfigurationProperty 在创建ConfigurationSection的继承类时,创建一个表示集合的属性就可以了,注意[ConfigurationProperty]的各参数。 get { return this["key"].ToString(); } set { this["key"] = value; } } [ConfigurationProperty

    2.2K10发布于 2019-02-25
  • 来自专栏逸鹏说道

    MVC5 网站开发之九 网站设置

    /// public class SiteConfig : ConfigurationSection { private static ConfigurationProperty ); [ConfigurationProperty("", Options = ConfigurationPropertyOptions.IsDefaultCollection)] 在类中声明一个配置元素的子元素 private static ConfigurationProperty _property,子元素的配置实体类型是KeyValueConfigurationCollection private static ConfigurationProperty _property = new ConfigurationProperty(string.Empty, typeof(KeyValueConfigurationCollection [ConfigurationProperty("", Options = ConfigurationPropertyOptions.IsDefaultCollection)] private

    1.5K50发布于 2018-04-10
  • 来自专栏大内老A

    WCF技术剖析之二十七: 如何将一个服务发布成WSDL[编程篇]

    ")] 6: public Uri ExternalMetadataLocation { get; set; } 7:  8: //HTTP 9: [ConfigurationProperty httpGetUrl")] 12: public Uri HttpGetUrl { get; set; } 13: [StringValidator(MinLength=0), ConfigurationProperty "httpGetBinding", DefaultValue="")] 14: public string HttpGetBinding { get; set; } 15: [ConfigurationProperty 16: public string HttpGetBindingConfiguration { get; set; } 17:  18: //HTTPS 19: [ConfigurationProperty "")] 24: public string HttpsGetBinding { get; set; } 25: [StringValidator(MinLength=0), ConfigurationProperty

    1K80发布于 2018-01-16
  • 来自专栏大内老A

    通过自定义配置实现插件式设计

    1: public class ResourceSettings: ConfigurationSection 2: { 3: [ConfigurationProperty("defaultProvider this["defaultProvider"];} 7: set{this["defaultProvider"] = value;} 8: } 9: [ConfigurationProperty class DbResourceProviderConfigurationElement : ResourceProviderConfigurationElement 2: { 3: [ConfigurationProperty class XmlResourceProviderConfigurationElement : ResourceProviderConfigurationElement 16: { 17: [ConfigurationProperty 1: public class NameTypeConfigurationElement : ConfigurationElement 2: { 3: [ConfigurationProperty

    97790发布于 2018-02-07
  • SpringBoot 过期属性报错问题分析及排查

    getPropertySourcesAsMap().forEach((name, source) -> candidates.forEach((metadata) -> { ConfigurationProperty configurationProperty = source .getConfigurationProperty(ConfigurationPropertyName.of(metadata.getId ())); if (configurationProperty ! = null) { result.add(name, new PropertyMigration(configurationProperty

    19610编辑于 2025-06-07
  • 来自专栏各类技术文章~

    SpringBoot 过期属性报错问题分析及排查

    getPropertySourcesAsMap().forEach((name, source) -> candidates.forEach((metadata) -> { ConfigurationProperty configurationProperty = source .getConfigurationProperty(ConfigurationPropertyName.of(metadata.getId ())); if (configurationProperty ! = null) { result.add(name, new PropertyMigration(configurationProperty

    2.1K01发布于 2021-11-03
  • 来自专栏大内老A

    控制并发访问的三道屏障: WCF限流(Throttling)体系探秘[上篇]

    sealed class ServiceThrottlingElement : BehaviorExtensionElement 2: { 3: //其他成员 4: [ConfigurationProperty maxConcurrentCalls", DefaultValue = 16)] 5: public int MaxConcurrentCalls { get; set; } 6:  7: [ConfigurationProperty ", DefaultValue = 26)] 8: public int MaxConcurrentInstances { get; set; } 9:  10: [ConfigurationProperty

    78480发布于 2018-01-16
  • 来自专栏跟着阿笨一起玩NET

    基础才是重中之重~用好configSections让配置信息更规范

    : ConfigurationSection { ///

    /// 网站名称 /// [ConfigurationProperty WebName"] = value; } } /// /// 网站域名 /// [ConfigurationProperty

    43810发布于 2018-09-19
  • 来自专栏跟着阿笨一起玩NET

    .net如何自定义config配置文件节点

    : ConfigurationSection { ///

    /// 网站名称 /// [ConfigurationProperty WebName"] = value; } } /// /// 网站域名 /// [ConfigurationProperty

    83410发布于 2018-09-19
  • 来自专栏大内老A

    开发自己的Data Access Application Block[上篇]

    . /// [ConfigurationProperty("name", IsRequired = true)] public string indicating the connection string to connect to the concrete database. /// [ConfigurationProperty /// A flag which determines if this is the default database. /// [ConfigurationProperty operation are all executed using command builder or stored procedure. /// [ConfigurationProperty / A CommandType enumeration indicating if the default command type. /// [ConfigurationProperty

    84990发布于 2018-02-07
  • 来自专栏菩提树下的杨过

    Enterprise Library 4.1学习笔记1----配置应用程序块(c/s和b/s均适用)

    System.Configuration; namespace ConfigTest { public class MyConfigClass : ConfigurationSection     {         [ConfigurationProperty         { get { return (string)this["name"]; } set { this["name"] = value; }         }         [ConfigurationProperty

    62770发布于 2018-01-23
  • 来自专栏c#Winform自定义控件系列

    c# RedisHelper

    return section; } ///

    /// 可写的Redis链接地址 /// [ConfigurationProperty } } /// /// 可读的Redis链接地址 /// [ConfigurationProperty value; } } /// /// 最大写链接数 /// [ConfigurationProperty value; } } /// /// 自动重启 /// [ConfigurationProperty /// 是否记录日志,该设置仅用于排查redis运行时出现的问题,如redis工作正常,请关闭该项 /// [ConfigurationProperty

    2.2K51发布于 2019-09-11
  • 来自专栏码匠的流水账

    聊聊springboot的ConfigurationProperties的绑定

    name, Bindable<T> target, BindHandler handler, Context context, boolean allowRecursiveBinding) { ConfigurationProperty target, elementBinder)); } private <T> Object bindProperty(Bindable<T> target, Context context, ConfigurationProperty = context.getConverter().convert(result, target); return result; } bindObject方法先通过findProperty获取ConfigurationProperty

    44921编辑于 2023-09-12
  • 来自专栏大内老A

    来源于WCF的设计模式:可扩展对象模式[下篇]

    1: public class RoomManagerSettings: ConfigurationSection 2: { 3: [ConfigurationProperty("rooms 1: public class RoomConfigurationElement : NameConfigurationElement 2: { 3: [ConfigurationProperty 1: public class WindowBuilderData : ExtensionConfigurationElement<Room> 2: { 3: [ConfigurationProperty { return (int)this["width"]; } 7: set { this["width"] = value; } 8: } 9: [ConfigurationProperty

    87090发布于 2018-02-07
领券