Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom attributes

Status
Not open for further replies.

Rodie

Programmer
Jun 27, 2004
132
FR
Hi all [smile2]

I have a class that contains several variable declarations.
From inside this class, I have methods that get the value of some of the previous variables, not all of them. I think I should have a kind of attribute to know which variables are part of the selection.

For example:
Code:
public class myclass {
  private string myvar1 = null;
  [XmlAttribute]
  private string myvar2 = null;
  private string myvar3 = null;
  ...
  private void getValue() {
    // get only the variable that have the [XmlAttribute] attribute
  }
}

Do you have any idea how I could do that?
Thanks a lot for your help [2thumbsup]
 
I'm not sure I see the value in doing this.

If your GetValue method needs to return different stuff at some point in the future, why not just make the change there, rather than adding/removing attributes?

Chip H.


____________________________________________________________________
Donate to Katrina relief:
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top