In looking at this question, commenter @Jon Egerton mentioned that MyClass
was a keyword in VB.Net
. Having never used it, I went and found the document
According to Jon Skeet, there is no such equivalent:
No, C# doesn't have an equivalent of VB.NET's MyClass keyword. If you want to guarantee not to call an overridden version of a method, you need to make it non-virtual in the first place.
An obvious workaround would be this:
public virtual void MyMethod()
{
MyLocalMethod();
}
private void MyLocalMethod()
{
...
}
Then you could call MyLocalMethod()
when a VB user would write MyClass.MyMethod()
.