Hi,
I created a class that implements the
System.Collecti ons.IDictionary interface and I declared
methods for implementing IDictionary, and also the
interfaces it inherited from, include ICollection and
IEnumerable.
I have problem in compiling my class and the C# compiler
complained about the method GetEnumerator() , which has
been implemented twice. I looked at the interfaces again
and found that both IEnumerable and IDictionary have this
method declared and I had both implemented. The one
declared in IEnumerable is :
public IEnumerator GetEnumerator() ;
and the one declared in IDictionary is:
public IDictionaryEnum erator GetEnumerator() ;
I tried to remove the IEnumerable.Get Enumerator
implementation but then the C# complains on the
incomplete implementation of the interface. Of course
same thing happened when I tried to remove the
IDictionary.Get Enumerator implementation. Therefore I
could remove neither of them.
I believe this could be a simple issue but I just don't
know how to resolve this problem. Any help out there is
appreciated.
Thanks in advance
I created a class that implements the
System.Collecti ons.IDictionary interface and I declared
methods for implementing IDictionary, and also the
interfaces it inherited from, include ICollection and
IEnumerable.
I have problem in compiling my class and the C# compiler
complained about the method GetEnumerator() , which has
been implemented twice. I looked at the interfaces again
and found that both IEnumerable and IDictionary have this
method declared and I had both implemented. The one
declared in IEnumerable is :
public IEnumerator GetEnumerator() ;
and the one declared in IDictionary is:
public IDictionaryEnum erator GetEnumerator() ;
I tried to remove the IEnumerable.Get Enumerator
implementation but then the C# complains on the
incomplete implementation of the interface. Of course
same thing happened when I tried to remove the
IDictionary.Get Enumerator implementation. Therefore I
could remove neither of them.
I believe this could be a simple issue but I just don't
know how to resolve this problem. Any help out there is
appreciated.
Thanks in advance
Comment