开发者

Prevent obsolete properties being added to the designer files

In one of the user controls in our project we开发者_开发知识库 have an obsolete property looking like :

    [Browsable ( false )]
    [Obsolete ( "Not currently supported on this control" )]
    public bool DeferPropertyValueUpdates

Every time I edit a form that contains this control, Visual Studio will put this property into the .designer file.

This then causes a warning to be generated, which makes my boss throw things at me.

How can I stop Visual Studio from putting this property in?


this is what you need

[Browsable(false), DesignerSerializationVisibility(
                            DesignerSerializationVisibility.Hidden)]


I believe a

    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

attribute is what you're looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜