locked
How to get base class type of a field RRS feed

  • Question

  • class WhatEver : Form
    {
            private Button buttonOk;
    }

    I'm enumerating all private fields.
    When i have a Field instance which refers to buttonOk,
    is it possible to decide the base class of the WhatEver class  ?

    I want it to return "Form" as the type when checking buttonOk.

    Is it possible ?





    Thursday, March 19, 2009 12:08 PM

Answers

  • Have you tried yourField.DeclaringType.BaseType?

    • Proposed as answer by Rob Seder Thursday, March 19, 2009 1:34 PM
    • Marked as answer by liurong luo Friday, March 20, 2009 1:42 AM
    Thursday, March 19, 2009 12:33 PM

All replies

  • Have you tried yourField.DeclaringType.BaseType?

    • Proposed as answer by Rob Seder Thursday, March 19, 2009 1:34 PM
    • Marked as answer by liurong luo Friday, March 20, 2009 1:42 AM
    Thursday, March 19, 2009 12:33 PM
  • Thanks :)
    Thursday, March 19, 2009 1:28 PM