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
NDepend v2023.1 have a IProperty and IEvent interfaces and both implement IAttributeTarget. New APIs have been added to properly query and rule those. https://www.ndepend.com/whatsnew#v2023-1-property-event
-
Anonymous commented
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()); -
When this will be implemented, IEvent will have to be implemented too.
-
Tim dos Santos commented
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.