我如何在 C# 中使用构造函数,如下所示:
public Point2D(double x, double y)
{
// ... Contracts ...
X = x;
Y = y;
}
public Point2D(Point2D point)
{
if (point == null)
ArgumentNullException("point");
Contract.EndContractsBlock();
this(point.X, point.Y);
}
我需要它不要从另一个构造函数复制代码......