configelement.cs
来自「自己做的一个浏览器~~大家请看看~如果合意给个彩头」· CS 代码 · 共 73 行
CS
73 行
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
namespace APLib.Common.Configuration
{
/// <summary>
/// 配置节类
/// <example><![CDATA[<nodename name="" value=""/>]]></example>
/// </summary>
public class ConfigElement : ConfigurationElement
{
#region 配置节属性
/// <summary>
/// 配置节配置值
/// </summary>
[ConfigurationProperty("value")]
public string Value
{
get
{
return this["value"] as string;
}
set
{
this["value"] = value;
}
}
/// <summary>
/// 配置节键值
/// </summary>
[ConfigurationProperty("name", IsKey = true, IsRequired = false)]
public string Name
{
get
{
return this["name"] as string;
}
set
{
this["name"] = value;
}
}
#endregion
/// <summary>
/// 重载IsReadOnly,写操作允许
/// </summary>
/// <returns>false</returns>
public override bool IsReadOnly()
{
return false;
}
/// <summary>
/// 构造函数
/// </summary>
public ConfigElement()
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="name">配置节键值</param>
public ConfigElement(string name)
{
Name = name;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?