用属性来传值
来源:互联网 发布:软件维护收费标准 编辑:程序博客网 时间:2024/05/16 11:50
定义:
[Serializable]
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple = true)]
public class ParameterMappingAttribute : System.Attribute
{
private string mstrVariableName = "";
public ParameterMappingAttribute()
{
}
public ParameterMappingAttribute(string pstrVariableName)
{
mstrVariableName = pstrVariableName;
}
public string VariableName
{
get { return this.mstrVariableName; }
set { this.mstrVariableName = value; }
}
}
使用:
private string mEv;
[ParameterMapping("xxxxxx")]
public string Ev
{
set { this.mEv = value; }
get { return this.mEv; }
}
- 用属性来传值
- 用javascript控制readonly属性,disabled属性
- 学用属性表
- AppendDataBoundItems属性小用
- 巧用系统属性
- 用C++实现属性
- 用C++实现属性
- 用css属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 为我的Blog加上了博客地图
- IT人访谈-关于创业部分
- 抛砖引玉系列 -- smarty缓存控制
- smarty学习笔记
- 提升PHP速度全攻略
- 用属性来传值
- 七朵水仙花
- 最新注册号码(不断更新)
- 用ISAPI_Rewrite实现反向代理(ReverseProxy)
- 超越模板引擎
- PHP:MVC迷思
- 创业全攻略献给想创业的朋友
- 工作日志
- 凌小宁先生的照片