考慮到以下設置,如何限制IConnection
只包含中Ports
的IPort
?也許我在這裏忽略了一些明顯的東西:接口和限制條件
Enum ConnectionType
{
Undefined,
Type1,
Type2
}
IConnection
{
ConnectionType ConnectionType {get;set}
IEnumerable<IPort> Ports {get;set;}
}
IPort
{
ConnectionType ConnectionType {get;set;}
}
有什麼需要複製的信息?如果所有端口都需要相同的連接類型,爲什麼不僅爲整個端口集合保留一次? – 2010-10-14 09:04:51