G
Guest
I have a question pertaining to the implementation of an interface's
contract, specifically why in some interfaces the InterfaceName.method is
required when other times just the Interfaces method name will work. For
example,
When using ICollection.CopyTo Method I can implement the CopyTo method as
follows (notice the interface name is omitted):
public void CopyTo(Array array, int index)
{
//.....
}
But when using IStateManager.LoadViewState method, I must specify the
Interface name followed by .MethodName (otherwise will receive a compilation
error).
void IStateManager.LoadViewState(object savedState)
{
//...
}
I am fairly new to Interfaces and would like clarification on this topic.
Thanks
contract, specifically why in some interfaces the InterfaceName.method is
required when other times just the Interfaces method name will work. For
example,
When using ICollection.CopyTo Method I can implement the CopyTo method as
follows (notice the interface name is omitted):
public void CopyTo(Array array, int index)
{
//.....
}
But when using IStateManager.LoadViewState method, I must specify the
Interface name followed by .MethodName (otherwise will receive a compilation
error).
void IStateManager.LoadViewState(object savedState)
{
//...
}
I am fairly new to Interfaces and would like clarification on this topic.
Thanks