G
Guest
I've built a complex collection object from
"System.Collections.CollectionBase". With regard to it, I have a question
about the "Contains" method.
At first I thought that "Contains" would actually search the entire
collection to tell me whether an object in the collection were identical with
the comparison object I was passing it. But I opened up the same collection
data into two separate collections (loaded them from disk) and did this:
Debug.WriteLine(obj1.Contains(obj2[0]).ToString());
and it returned 'False". Now I *KNOW* that the first elements of both
objects are absolutely identical but the Contains method doesn't seem to
agree.
So I'm wondering what are the limitations of "Contains" when it comes to
collections.
"System.Collections.CollectionBase". With regard to it, I have a question
about the "Contains" method.
At first I thought that "Contains" would actually search the entire
collection to tell me whether an object in the collection were identical with
the comparison object I was passing it. But I opened up the same collection
data into two separate collections (loaded them from disk) and did this:
Debug.WriteLine(obj1.Contains(obj2[0]).ToString());
and it returned 'False". Now I *KNOW* that the first elements of both
objects are absolutely identical but the Contains method doesn't seem to
agree.
So I'm wondering what are the limitations of "Contains" when it comes to
collections.