Marking an Unused Method as Used

I have a small class that uses reflection to call private methods in the
class itself. Since the methods are private and are not explicitly used
by the class (except through reflection), I get a R# warning and the
method names are greyed out. Is there any way to tag (perhaps with an
attribute) these methods so that R# doesn't treat them as unused?

2 comments
Comment actions Permalink

Never mind. I spoke too soon. It seems you cannot use reflection on
private methods without going through a whole lot of trouble so I made
them public.

In article <MPG.20575a728cf20f7989684@news.jetbrains.com>,
notme@nowhere.com says...

I have a small class that uses reflection to call private methods in the
class itself. Since the methods are private and are not explicitly used
by the class (except through reflection), I get a R# warning and the
method names are greyed out. Is there any way to tag (perhaps with an
attribute) these methods so that R# doesn't treat them as unused?

0
Comment actions Permalink

You can just mark them by any attribute, and they won't be greyed

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Alon Albert" <notme@nowhere.com> wrote in message
news:MPG.20575a728cf20f7989684@news.jetbrains.com...
>I have a small class that uses reflection to call private methods in the

class itself. Since the methods are private and are not explicitly used
by the class (except through reflection), I get a R# warning and the
method names are greyed out. Is there any way to tag (perhaps with an
attribute) these methods so that R# doesn't treat them as unused?



0

Please sign in to leave a comment.