Marcel,
You can definitely use reflection to do this, but at the same time, I
don't think it is a good idea. Value equality is difficult to standardize
depending on the nature of the definition of the object (and how it relates
to what it is representing).
If you still want to go with it though, you can reflect on protected,
private, and internal members using the NonPublic value from the
BindingFlags enumeration. Usually, most overloads of the methods you use to
get fields, properties, methods, etc, etc will take a group of values from
the BindingFlags enumeration to indicate what to reflect on.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Marcel Sottnik" <so*****@removethisoption.ch> wrote in message
news:uD**************@TK2MSFTNGP15.phx.gbl...
Hallo NG
Does anyone have an idea how could one implement, a general routine for
value equality ?
I mean something using Reflections to get all the members of a class and
compare them recursivelly until the comparison of value type is reached. I
found in Reflections only getting of public members. Although the internal
state of an object should not be interesting for evalution of equality I
would like to make a value equality check also with values at least
protected members...
Thx for any input