Refactor method access modifier in visual studio (c#)

Viewed 348

I have the following problem. I'm working in visual studio. Let's say, I have an abstract method in base class.

public abstract void DoSomething();

And I override this method in derived classes.

public override void DoSomething();

How can I change the access modifier in base and derived classes automatically? I've tried to use Resharper, but I didn't find anything.

1 Answers

With ReSharper:

  1. Place caret to "public" keyword in the method signature
  2. Press "Alt+Enter" and select new desired modifier (ie "to protected") Result: modifiers for all methods in the hierarchy are changed
Related