What I have done is create virtual methods which the explicit interface
definitions just pass the parameters and return values between, for example:
public interface IMyInterface
{
string Op(string param);
}
public class MyClass : IMyInterface
{
string IMyInterface.Op(string param)
{
// Just call the internal method.
return InternalOp(param);
}
protected virtual string InternalOp(string param)
{
// Do work here.
}
}
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"wdudek" <wd****@newsgroup.nospamwrote in message
news:F2**********************************@microsof t.com...
>I know that I can't declare a method in an interface as virtual and
override
it, when I am using an explicit interface, but I am wondering if anyone
else
has come across this problem and how they handled it? I would definately
prefer to use explicit interfaces, but I also know I shouldn't mix and
match
explicit versus implicit interfaces and don't seem to have a choice here?
Any thoughts on this?