X hits on this document

1041 views

0 shares

0 downloads

0 comments

362 / 396

Appendix ‎A   Documentation comments

/// <summary>This method changes the point's location by ///the given x- and y-offsets. /// <example>For example: /// <code> ///Point p = new Point(3,5); ///p.Translate(-1,3); /// </code> /// results in <c>p</c>'s having the value (2,8). /// </example> /// </summary> /// <param><c>xor</c> is the relative x-offset.</param> /// <param><c>yor</c> is the relative y-offset.</param> /// <see cref="Move"/> public void Translate(int xor, int yor) { X += xor; Y += yor; }

/// <summary>This method determines whether two Points have the same ///location.</summary> /// <param><c>o</c> is the object to be compared to the current object. /// </param> /// <returns>True if the Points have the same location and they have ///the exact same type; otherwise, false.</returns> /// <seealso cref="operator=="/> /// <seealso cref="operator!="/> public override bool Equals(object o) { if (o == null) { return false; }

if (this == o) { return true; }

if (GetType() == o.GetType()) { Point p = (Point)o; return (X == p.X) && (Y == p.Y); } return false; }

/// <summary>Report a point's location as a string.</summary> /// <returns>A string representing a point's location, in the form (x,y), ///without any leading, training, or embedded whitespace.</returns> public override string ToString() { return "(" + X + "," + Y + ")"; }

Copyright Microsoft Corporation 1999-2003. All Rights Reserved.349

Document info
Document views1041
Page views1041
Page last viewedSat Dec 10 10:07:40 UTC 2016
Pages396
Paragraphs9401
Words133190

Comments