I have the following base interface
public interface IBaseAction
{
bool CanAct(...)
}
and two inheriting interface say
public interface IAction1 : IBaseAction{}
and
public interface IAction2 : IBaseAction{}
My problem is, I have a class which implements both, and I want to implement CanAct DIFFERENTLY.
public class ComplexAction : IAction1, IAction2
{
bool IAction1.CanAct(...){} //doesn't compile as CanAct is not a member of IAction1!!
}
ComplexAction c=new ComplexAction();
var a1 = (IAction1)c;
var a2 = (IAction2)c;
a1.CanSave(); //THESE TWO CALLS SHOULD BE IMPLEMENTED DIFFERENTLY
a2.CanSave();
Is there a reasonably clean way to do this?
(Also, my interfaces have semantic meaning and at least three more functions, so it is out of the question to throw out the whole hierarchy, but I'd be willing to copy bool CanAct to every inheriting interface if that is the only solution (there are 4-6 of them))