NDepend Users Voice

Create an NDepend.CodeModel.IProperty interface

This would be especially handy to detect with CQLinq when a property is tagged with an attribute, and also to jump from the getter method to the setter method and vice-versa. So IProperty would have to implement the interface NDepend.CodeModel.IAttributeTarget

63 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
AdminPatrick Smacchia (Senior Software Engineer, NDepend) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

3 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...
  • Anonymous commented  ·   ·  Flag as inappropriate

    This would help me with my use case which is where the attribute is attached to the property instead of the getter:-

    [LazyInitializer]
    protected object Container => container ?? (container = new object());

  • Tim dos Santos commented  ·   ·  Flag as inappropriate

    Yes, please implement this! I'm looking for a way to check for attributes on properties (not on the getter/setter) to enforce publicly visible properties of user controls to be annotated with [Browsable(false)] and [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)], unless explicitly justified with a comment.

Feedback and Knowledge Base