2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 /// The Point is a struct that defines a 2-D point as a pair of generic type.
24 public struct Point : IEquatable<Point>
27 /// Location along the horizontal axis.
32 /// Location along the vertical axis.
36 public override string ToString()
38 return string.Format("{{X={0} Y={1}}}", X, Y);
41 public override int GetHashCode()
45 return X.GetHashCode() ^ (Y.GetHashCode() * 397);
49 public override bool Equals(object obj)
54 return Equals((Point)obj);
57 public bool Equals(Point other)
59 return X.Equals(other.X) && Y.Equals(other.Y);
63 /// Whether the two <see cref="T:Tizen.UI.Point" />s are equal.
65 /// <param name="p1">A <see cref="T:Tizen.UI.Point" /> on the left hand side.</param>
66 /// <param name="p2">A <see cref="T:Tizen.UI.Point" /> on the right hand side.</param>
67 /// <returns>True if the two <see cref="T:Tizen.UI.Point" />s have equal values.</returns>
68 public static bool operator ==(Point p1, Point p2)
74 /// Whether two <see cref="T:Tizen.UI.Point" />s are not equal.
76 /// <param name="p1">A <see cref="T:Tizen.UI.Point" /> on the left hand side.</param>
77 /// <param name="p2">A <see cref="T:Tizen.UI.Point" /> on the right hand side.</param>
78 /// <returns>True if the two <see cref="T:Tizen.UI.Point" />s do not have equal values.</returns>
79 public static bool operator !=(Point p1, Point p2)
81 return !p1.Equals(p2);