首页 > Windows开发 > 详细

C# .net dotnet属性定义属性,以提供显示明称,默认值

时间:2016-12-06 20:06:15      阅读:231      评论:0      收藏:0      [点我收藏+]
//使用显示名称初始化 System.ComponentModel.DisplayNameAttribute 类的新实例。 displayName 显示名称
[DisplayName("weight")]
//初始化默认值 System.ComponentModel.DefaultValueAttribute 类的实例。支持所有类型,如字符串string,double,long,int,object,type,等等
[DefaultValue(100)]
public int Weight { get; set; }

 

C# .net dotnet属性定义属性,以提供显示明称,默认值

原文:http://www.cnblogs.com/webenh/p/6138859.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!