码迷,mamicode.com
首页 > 其他好文 > 详细

[Browsable(false)]

时间:2016-02-20 18:56:00      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:

1.c#方法上面的[Browsable(false)]是干吗用的?

答案:标明此对象不可被浏览,这样它就不会出现在设计器的属性窗口里了

看如下代码:

   /// <include file=‘AspNetPagerDocs.xml‘ path=‘AspNetPagerDoc/Property[@name="ImagePath"]/*‘/>
        [Browsable(true), Category("Appearance"), ANPDescription("desc_ImagePath"), DefaultValue(null)]
        public string ImagePath
        {
            get
            {
                if (null != cloneFrom)
                    return cloneFrom.ImagePath;
                string imgPath = (string)ViewState["ImagePath"];
                if (imgPath != null)
                    imgPath = ResolveUrl(imgPath);
                return imgPath;
            }
            set
            {
                string imgPath = value.Trim().Replace("\\", "/");
                ViewState["ImagePath"] = (imgPath.EndsWith("/")) ? imgPath : imgPath + "/";
            }
        }

 

[Browsable(false)]

标签:

原文地址:http://www.cnblogs.com/ChineseMoonGod/p/5203695.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!