G
Guest
Is it possible to create an attribute targeted at a field that will
automatically create get/set properties for that field given a property name?
I envision the code would look like this:
[CreatPropertyAttribute("TextName","public","get/set")]
private string _name;
=========================================
Then this code would be created at runtime:
public string TextName
{
get { return _name; }
set { _name=value; }
}
===========================================
I am trying to better understand custom attributes and how they might
simplify my life. Is my proposed attribute possible or am I missing the
concept completely?
Thanks for any help.
-Keith
automatically create get/set properties for that field given a property name?
I envision the code would look like this:
[CreatPropertyAttribute("TextName","public","get/set")]
private string _name;
=========================================
Then this code would be created at runtime:
public string TextName
{
get { return _name; }
set { _name=value; }
}
===========================================
I am trying to better understand custom attributes and how they might
simplify my life. Is my proposed attribute possible or am I missing the
concept completely?
Thanks for any help.
-Keith