I have some auto-instantiation code which I would like to apply to about 15 properties in a fairly big class. The code is similar to the following but the type is differ
Try to use Hashtable or Dictionary to group all properties. Something like this:
protected Dictionaty _properties = new Dictionaty();
public ComplexType Property(string name)
{
get
{
if (!properties.ContainsKey(name))
_properties[name] = new ComplexType();
return __properties[name];
}
}