IBindingList-- Why is explicit interface implementation required?

D

Dave Veeneman

I'm working my way through the IBindingList interface, and I am puzzled by
something: Theexample in the IBindingList Overview (.NET Framework
documentation) uses explicit implementation for each of the IBindingList
elements implemented in the collection class.

For example, the implementation of the IBindingList AddNew method is
declared as an explicit implementation:

object IBindingList.AddNew() {...}

instead of more simply as an implicit implementation:

object AddNew() {...}

I tried changing the example's AddNew implementation from the first form to
the second form, and the compiler threw an exception because the collection
class no longer implemented the IBindingList AddNew method. So, obviously,
explicit declarations are required.

My question is, why? I can't find anything in the IBindingList documentation
explaining why explicit implementation is required. Thanks in advance.
 
D

Dave Veeneman

Found my answer-- The implementation of IBindingList doesn't have to be
explicit-- that's just the way they did it in the example. (I was getting
the compiler error for another reason).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top