Explicit
Interface Implementation
Implementing multiple
interfaces can sometimes result in a collision between member signatures. You
can resolve such collisions by explicitly
implementing an interface member. Consider the
following example:
interface I1 { void Foo(); }
interface I2 { int Foo(); }
public class Widget : I1, I2
{
public void Foo()
{
Console.WriteLine("Widget's
implementation of I1.Foo");
}
int I2.Foo()
{
Console.WriteLine("Widget's
implementation of I2.Foo");
return 42;
}
}
