I'm currently studying for my MS 70-515 exam. In one of the practices the author implements an interface both implicit as well as explicit. The explicit implementation just calls the implicit implementation. The explicit implementation is just listed without an explanation.
Does it make sense to have both an implicit and an explicit implementation of the interface? I would think the explicit implementation is redundant (in this case).
public class PassTextBox : TextBox, IScriptControl
{
public virtual IEnumerable<ScriptDescriptor> GetScriptDescriptors()
{
var descriptor = new ScriptControlDescriptor(
"AjaxEnabled.PassTextBox", ClientID);
// ...
return new ScriptDescriptor[] {descriptor};
}
IEnumerable<ScriptDescriptor> IScriptControl.GetScriptDescriptors()
{
return GetScriptDescriptors();
}
}
BTW, the code seems to run just fine without the explicit implementation, as the implicit implementation is public.
It concerns MCTS Self-Paced Training Kit (Exam 70-515): Web Applications Development with Microsoft .NET Framework 4 Chapter 9, Lesson 2, Practice 3 to be precise.