开发者

CodeDOM: Adding DebuggerStepThroughAttribute to property

开发者 https://www.devze.com 2022-12-23 05:05 出处:网络
I know how to add a DebuggerStepThroughAttribute to a method or a constructor, usually you add it to the CustomAttributes collection of a code member. But I don\'t see a way to do this for the setter

I know how to add a DebuggerStepThroughAttribute to a method or a constructor, usually you add it to the CustomAttributes collection of a code member. But I don't see a way to do this for the setter and getter of a C# property, because neither of them provides this collection where yo开发者_运维百科u add the attributes. Does anyone have a clue?


The DebuggerStepThroughAttribute is targetted at methods, constructors, structs and classes. It cannot be applied to fields or properties. You can, however, use DebuggerNonUserCodeAttribute to achieve a similar aim.

That said, attributes can be applied to CodeMemberProperty. The documentation states that it inherits CustomAttributes from the CodeTypeMember base class.

0

精彩评论

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

关注公众号