考虑到以下设置,如何限制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