E
Elhanan
hi..
i wanted to build a Dictionary Classs that will load my own class
called letter,
i understood that i implement the IEquatable interface's equles method
that then the dictionary would use that inorder to compare the keys, so
i went ahead the implented it in the LETTER class so letter would
provice it's own means for comparison, but the dictionary ignored it
only when i created a new class, called it letterkey ,had it implement
EqualityComparer that will compare to classes , have it's GetHashCode
always return 0, only i managed to compare the two classes.
is that right? that's the only way i got it to work.
so now i have:
Dictionay<Letter,Letter> letters= new Dictionay<Letters,Letters>(new
LetterKey())
i wanted to build a Dictionary Classs that will load my own class
called letter,
i understood that i implement the IEquatable interface's equles method
that then the dictionary would use that inorder to compare the keys, so
i went ahead the implented it in the LETTER class so letter would
provice it's own means for comparison, but the dictionary ignored it
only when i created a new class, called it letterkey ,had it implement
EqualityComparer that will compare to classes , have it's GetHashCode
always return 0, only i managed to compare the two classes.
is that right? that's the only way i got it to work.
so now i have:
Dictionay<Letter,Letter> letters= new Dictionay<Letters,Letters>(new
LetterKey())