ReSharper has a [UsedImplicitly] attribute which ignores properties that are not being directly referenced. This is recommended to be used by JetBrains: https://www.jetbrains.com/help/resharper/2016.1/MemberCanBePrivate.Global.html
Is there any way to apply this attribute at a namespace level? Or is there another way to ignore all classes within a given namespace (and possibly all child namespaces)?
This answer does not answer the question but it might be helpful.
I have an attribute called PluginEntryPointAttribute
.
public class PluginEntryPointAttribute : Attribute
{
}
And my code used to look like this:
[PluginEntryPointAttribute]
[UsedImplicitly]
public void SomeEntryMethod()
{
// code
}
I need the UsedImplicitly attribute so that ReSharper does not mark my SomeEntryMethod as not used.
My new code looks like this thanks to [JetBrains.Annotations.MeansImplicitUse]
:
[JetBrains.Annotations.MeansImplicitUse]
public class PluginEntryPointAttribute : Attribute
{
}
Now on my code, I do not need to include the UsedImplicitly attribute:
[PluginEntryPointAttribute]
// [UsedImplicitly] no need to use it because PluginEntryPointAttribute has the MeansImplicitUse attribute
public void SomeEntryMethod()
{
// code
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With