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

推荐订阅源

GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cisco Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
IT之家
IT之家
博客园 - 【当耐特】
V
V2EX
博客园_首页
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 司徒正美
N
Netflix TechBlog - Medium
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
S
Schneier on Security
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
Vercel News
Vercel News
量子位
G
GRAHAM CLULEY
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cybersecurity and Infrastructure Security Agency CISA
S
Security @ Cisco Blogs
B
Blog
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
A
About on SuperTechFans
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
S
Securelist
博客园 - 聂微东
Cloudbric
Cloudbric
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
N
News | PayPal Newsroom
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
W
WeLiveSecurity
Martin Fowler
Martin Fowler
K
Kaspersky official blog
S
Security Affairs
TaoSecurity Blog
TaoSecurity Blog

博客园 - 大老鼠

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)  评论()    收藏  举报