惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
Simon Willison's Weblog
Simon Willison's Weblog
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
量子位
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
爱范儿
爱范儿
S
Secure Thoughts
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
D
Docker
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
Y
Y Combinator Blog
博客园 - 三生石上(FineUI控件)
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
Recorded Future
Recorded Future
罗磊的独立博客
Forbes - Security
Forbes - Security
Security Latest
Security Latest
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
T
Tenable Blog
C
Cybersecurity and Infrastructure Security Agency CISA
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
K
Kaspersky official blog
月光博客
月光博客
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic

博客园 - 大老鼠

JQuery ajax 传递数组 JQuery元素坐标,偏移量 IE8按F12不显示开发人员工具窗口 JQuery AJAX调用WEB SERVICE方法 JQuery Validate验证表单元素 - 大老鼠 - 博客园 序列化/反序列化JSON sqlserver使用select加锁 jQuery操作解析JSON (sp_dbcmptlevel)将某些数据库行为设置为与指定的 SQL Server 版本兼容。 jQuery使用手册 效果-为操作添加艺术性 DOM操作-基于命令改变页面 事件 选择符-取得你想要的一切 jQuery入门 动态修改样式和层叠样式表 - 大老鼠 - 博客园 DOM2核心和DOM2 HTML 创建可重用的对象 JavaScript中常见陷阱 - 大老鼠 - 博客园
自定义属性
大老鼠 · 2010-07-31 · via 博客园 - 大老鼠

代码

 1     /// <summary>
 2     /// 自定义属性
 3     /// </summary>
 4     [AttributeUsage(AttributeTargets.All, Inherited = false)]
 5     public sealed class CustomAttribute : Attribute {
 6         private string _UserName = null;
 7 
 8         /// <summary>
 9         /// 只对必填参数使用构造函数赋值
10         /// 避免提供构造函数参数来对可选属性(可选参数)进行初始化
11         /// 避免对自定义属性的构造函数进行重载,只定义一个构造函数可以清楚的告诉用户哪些参数是必填的,哪些参数是可选的
12         /// 要尽可能将自定义属性类密封起来,这样会使查找更快
13         /// </summary>
14         /// <param name="userName">必填参数</param>
15         public CustomAttribute(string userName) {
16             this._UserName = userName;
17         }
18 
19         /// <summary>
20         /// 必填参数
21         /// </summary>
22         public string UserName { get { return this._UserName; } }
23 
24         /// <summary>
25         /// 可选参数
26         /// </summary>
27         public int Age { getset; }
28     }

posted on 2010-07-31 18:12  大老鼠  阅读(550)  评论()    收藏  举报