protected attributes / retrieving

  • Thread starter ViperDK \(Daniel K.\)
  • Start date
V

ViperDK \(Daniel K.\)

I want to make my own attributes that should only be used in derived classes
so the base class can get some metadata of fields in derived classes. for
that reason i try to define a new attribute class in my base class and use
it in the derived classes...

so far so good but when i want to retrieve the attributes with
Type.GetCustomAttributes it doesn't work until i make the attribute class
public. Is there another way to access attributes or are protected
attributes just a thing you can apply for fun but never read out?

thx in advance,
ViperDK
 
F

Fritz

ViperDK said:
I want to make my own attributes that should only be used in derived
classes so the base class can get some metadata of fields in derived
classes. for that reason i try to define a new attribute class in my base
class and use it in the derived classes...

so far so good but when i want to retrieve the attributes with
Type.GetCustomAttributes it doesn't work until i make the attribute class
public. Is there another way to access attributes or are protected
attributes just a thing you can apply for fun but never read out?

thx in advance,
ViperDK
Please let me know ([email protected]) when you find a way. I have run
in the same problem
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top