我对这种将条件分配给布尔变量的这种方式真的很陌生。如何直接使用条件分配一个布尔变量
比方说,我有这样的
bool type;
if (((sDataSet.Shipment[0].CI_TYPE == Constants.ShipType.CI_R) &&
(shipType == Constants.ShipType.CI_R)) ||
((sDataSet.Shipment[0].CI_TYPE == Constants.ShipType.CI_P) &&
(shipType == Constants.ShipType.CI_R)) ||
((sDataSet.Shipment[0].CI_TYPE == Constants.ShipType.CI_R) &&
(shipType == Constants.ShipType.CI_P)))
type = true;
else
type = false;
如何直接分配型布尔这种状况呢?优化或更好的方式。
@CodeCaster:所以再次感谢你:)干杯 – Learner