C
Charles
How often have you seen this kind a of construct in a .NET class:
class A
{
private string b;
public string B
{
get { return b; }
set { b = value; }
}
}
Wouldn't it be nice to have an attribute you could place on the member
data that would automatically generate the corresponding properties?
It would look something like this:
class A
{
[Property(name="B", get=true, set=true)]
private string b;
}
Has anyone see something similar to this? There seems to be no way to
write a custom attribute that generates code at compile time, but
perhaps there's another way to accomplish such a thing?
Charles
class A
{
private string b;
public string B
{
get { return b; }
set { b = value; }
}
}
Wouldn't it be nice to have an attribute you could place on the member
data that would automatically generate the corresponding properties?
It would look something like this:
class A
{
[Property(name="B", get=true, set=true)]
private string b;
}
Has anyone see something similar to this? There seems to be no way to
write a custom attribute that generates code at compile time, but
perhaps there's another way to accomplish such a thing?
Charles