I need to analyse my object and show some properties of it in a list. My object has some properties, which come from base class "ObjectBaseClass", these properties should not be shown in my list.
How can i know, wheather a property is from base-class or not?
i.e I have a interface IDisposableExtended, this interface will be implemented in my object class. But in my list, i don't want to show these two properties "Disposable" and "Disposed". How can i filter them?
public interface IDisposableExtended : IDisposable
{
bool Disposable { get; }
bool Disposed { get; }
}
Thanks a lot!
p.s The properties can come from a base-class(level 1), base-class(level 1) can also have some properties from his own base-class(level 2). Is that so, when i use GetProperties(flags), which contains BindingFlags.DeclaredOnly, all the properties come from base-classes (level 1 and level 2) will be filtered? Can i just filter base-class level 1 or level 2? That means, i want to get all properties first, and filter then according to their base-class manually. Then i have all control of them to show the properties, which i need.