本文整理汇总了C#中PointD.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PointD.ToString方法的具体用法?C# PointD.ToString怎么用?C# PointD.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointD
的用法示例。
在下文中一共展示了PointD.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_Constructor
public void Test_Constructor()
{
PointD point = new PointD();
Assert.AreEqual(0.0, point.X);
Assert.AreEqual(0.0, point.Y);
point = new PointD(5);
Assert.AreEqual(5.0, point.X);
Assert.AreEqual(5.0, point.Y);
point = new PointD(5, 10);
Assert.AreEqual(5.0, point.X);
Assert.AreEqual(10.0, point.Y);
ExceptionAssert.Throws<ArgumentNullException>(delegate ()
{
new PointD(null);
});
ExceptionAssert.Throws<ArgumentException>(delegate ()
{
new PointD("");
});
ExceptionAssert.Throws<ArgumentException>(delegate ()
{
new PointD("1.0x");
});
ExceptionAssert.Throws<ArgumentException>(delegate ()
{
new PointD("x1.0");
});
ExceptionAssert.Throws<ArgumentException>(delegate ()
{
new PointD("ax1.0");
});
ExceptionAssert.Throws<ArgumentException>(delegate ()
{
new PointD("1.0xb");
});
point = new PointD("1.0x2.5");
Assert.AreEqual(1.0, point.X);
Assert.AreEqual(2.5, point.Y);
Assert.AreEqual("1x2.5", point.ToString());
}
示例2: Density
public void Density(PointD value)
{
_NativeInstance.Density(value.ToString());
}