I have a hierarchy
public
class
Corner
{
public
string
Name {
get
;
set
; }
}
public
class
Fillet : Corner
{
public
double
Radius {
get
;
set
; }
}
public
class
Chamfer : Corner
{
public
double
Distance1 {
get
;
set
; }
public
double
Distance2 {
get
;
set
; }
}
and a business object,
public
enum
CornerMode
{
Fillet,
Chamfer
}
public
class
CornerAttribute
{
public
CornerMode CornerMode {
get
;
set
;}
public
Corner Corner {
get
;
set
;}
}
I will assign a subclass instance according to the CornerMode. How to switch the type convert at runtime so that the property Corner can be expandable?