I have a class with a Property called 'Value' which is of type Object. Value can be of any type, a structure, a class, an array, IList etc.
My problem is with the setter and determining whether the value has changed or not. This is simple enough for value types, but reference types and lists present a problem.
For a class, would you assume that the Equals method has been implemented correctly, or just assume that the value has changed every time the setter is called? If I did assume it's changed, then perhaps I should assume it for value types as well, so that the behaviour is consistent.
For a list, I could check the size and then every item in the collection to see if they have changed.
How do you guys handle this problem?