Is there a datastructure like a Dictionary that allows adding unique elements based on the .Equals() call defined for a given class rather than hash value.
In my case, I have a PointD class defining a point with decimal X and Y. Due to the nature of decimal types being a little inexact, creating a hash on the point is not possible, as a small error between two points that are essentially the same will cause major difference in hash value.
Basically, I want to be able to count the number of points of each x, y combination. Is there an existing mechanism for this, or do I need to implement this myself?
Be careful. It sounds like you want to define Equals so that values within a certain tolerance are considered equal. If you do that, Equals will not be transitive, but it needs to be transitive for the dictionary to function.
Example: suppose x is smaller than y by 0.8 times the tolerance. They would be considered equal. Now consider the value z, which is larger than y by 0.8 times the tolerance. Therefore y and z are also equal. But x and z are not equal!
GetHashCode must return the same value for two equal objects. Since equality is not transitive in this system, you can prove that GetHashCode needs to return the same value for all objects, which causes your dictionary to act like a linked list (but with more storage overhead, that gets wasted).
You could solve this by rounding all the points to a certain degree of precision, and calculating both the hash code and equality from the rounded value. That approach may have pitfalls of its own, of course.