That will not work.
Resharper is using the name provided by the interface itself - and in order to implement it, you cannot change this name (even casing).
"MyMethod" is the name as specified in "IMyInterface". You must preserve the casing in order to implement that method, and since you're explicitly implementing it, there are no options.
Edit after comments:
Here is an example. I just made an interface, like so:
internal interface IMyInterface
{
void testmethod();
}
This violates my current naming conventions (Resharper asks to capitalize testmethod in this case).
If I then make a class that implements this interface:
class MyClass : IMyInterface
{
And I choose to "Implement Interface Explicitly", Resharper creates:
class MyClass : IMyInterface
{
#region IMyInterface Members
void IMyInterface.testmethod()
{
throw new NotImplementedException();
}
#endregion
}
In this case, it does not complain about the casing in the line: void IMyInterface.testmethod()
There would be no way to implement the interface using a different casing than the one in the interface, however - that doesn't matter whether it's explicitly or implicitly defined - the interface determines the name of the method, including the case.
I think the confusion may be due to the fact that you're assuming that, in my case, testmethod
is private - it is not a private method, it's a public, explicit implementation of IMyInterface.testmethod
, which is why you can do:
IMyInterface myClass = new MyClass();
myClass.testmethod(); // This is public on IMyInterface, not private!
You cannot change the case of the method implementing your interface - this is a .NET restriction, not a Resharper restriction.