If I use
sometype.GetProperties();
I get all of the properties from the type and it's parent. However I only want to retrieve the properties defined explicitly in this type (not the parents). I thought that was what the BindingFlags.DeclaredOnly
option was for.
However, when I try this:
sometype.GetProperties(BindingFlags.DeclaredOnly);
I get 0 properties.
Anyone know what I am doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…