public static void SizeDTest() { Console.WriteLine("++++++++++++++++++++SizeD++++++++++++++++++++++"); SizeD c1 = new SizeD(102.01, 2990.19945); Console.WriteLine("Size 01:{0}", c1.ToString()); try { SizeD c2 = SizeD.Parse(c1.ToString()); Console.WriteLine("Size 02:{0}", c2.ToString()); if (c2 == c1) { Console.WriteLine("01 == 02"); } else { Console.WriteLine("01 != 02"); } } catch (Exception ex) { Console.WriteLine("SizeD.Parse failed, {0}.", ex.Message); } Console.WriteLine("==============================================="); }
/// <summary> /// 偏移点的坐标 /// </summary> /// <param name="size">偏移的大小</param> public void Offset(SizeD size) { this.Offset(size.Width, size.Height); }
/// <summary> /// Constructor /// </summary> /// <param name="location">位置</param> /// <param name="size">大小</param> public RectangleD(PointD location, SizeD size) : this(location.X, location.Y, size.Width, size.Height) { }