Given the following:
public abstract class Base
{
public static void StaticMethod()
{
PrivateMethod();
}
}
public sealed class Derived: Base
{
public void InstanceMethod()
{
PrivateMethod();
}
}
I need to use PrivateMethod () from two different contexts (different assemblies). A call Base.StaticMethod()and a second time using an instance of the Derived class d.InstanceMethod();.
I am looking for a way to develop PrivateMethod () inside a base class. Of course, PrivateMethod () should not be visible outside the Base and Derived classes.
I was thinking something about "protected static PrivateMethod () {}", but I read that I shouldn't do this ...
What do you recommend to guys?
source
share