Get list of inherited controls

Hello,
I have the following class schema:



public class A : System.Windows.Forms.Form
{
    protected Panel panelA;
}
public class B : A
{
    protected Panel panelB;
}

 


How do I know that panelA is a member of A, and panelB a  member of  B  class   I need to serialize class B, and when I do that, inherited controls are also serialized (through b.Controls).


Answer this question

Get list of inherited controls

  • darentan

    Maybe I'm missing something but why is it a problem that the inherited controls are also serialized Wouldn't you want to do that



  • Krad

    No, I don't want to do that. When I deserialize the form, the base class is A (not System.Windows.Forms.Form), and some of my controls (panelA in my example) are recreated twice. Anyway, I've done it by setting the Tag property of inherited members to something not null, and when I'm serializing it i check for that value (but I don't like this method, maybe I'll need the Tag property somewhere else).
  • Get list of inherited controls