日期:2014-05-18 浏览次数:20975 次
public static bool operator ==(MyShape lhs, object rhs) { if( object.ReferenceEqual(lhs, rhs) ) return true; if( object.ReferenceEqual(lhs,null) || object.ReferenceEqual(rhs,null) ) return false; ... } public static bool operator !=(MyShape lhs, object rhs) { return !(lhs == rhs); }