Override member cannot change access rights

CodeRush shows the Override member cannot change access rights code issue if an override member access modifier does not match the overridden member access modifier.

Fix

Specify the same access modifier for the override and base members.

Purpose

Highlights the member declarations, which would cause the 'Member name': cannot change access modifiers when overriding inherited member compilation error.

Example

public class MyBase
{
    public virtual void ProcessText(string text)
    {
        Console.WriteLine(text);
    }
}
public class MyClass: MyBase
{
    internal override void ProcessText(string text)
    {
        base.ProcessText(text);
    }
}

Fix:

public class MyBase
{
    public virtual void ProcessText(string text)
    {
        Console.WriteLine(text);
    }
}
public class MyClass: MyBase
{
    public override void ProcessText(string text)
    {
        base.ProcessText(text);
    }
}