Reflection and custom property

R

raulavi

C# vs2008

need to write the correct customAttribute code.

I will have a class with properties having custom attributes

How can I use reflection to read the class and extract only properties
with attribute "onBrowse" with value true and the size assigned to the
property
thanks

sample:
Class TheClass
private string somevar1;
public string SomeVar1
{
....
}

private string varBrw1;
[onBrowse=true] //or [onBrowse["true")]

public string VarBrw1
{
....
}

so on

need to run reflection and get
varBrw1 and all the others with the correct attribute = true
and display the size attribute value
 
R

raulavi

jeff..thanks

not quite...been there.. tried that code...but there are pieces missing for
my purpose.

been reading about custom properties and got something working. still need
a pseudo code to complete my task.
 
J

Jeff Johnson

not quite...been there.. tried that code...but there are pieces missing
for
my purpose.

been reading about custom properties and got something working. still need
a pseudo code to complete my task.

At this point you'd need to post the code showing what you're currently
trying to do and where you believe it's falling short of your needs.
 

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