[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Point.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18
19 namespace ElmSharp
20 {
21     /// <summary>
22     /// The Point is a struct that defines the 2D point as a pair of generic type.
23     /// </summary>
24     /// <since_tizen> preview </since_tizen>
25     [Obsolete("This has been deprecated in API12")]
26     public struct Point : IEquatable<Point>
27     {
28         /// <summary>
29         /// Location along the horizontal axis.
30         /// </summary>
31         /// <since_tizen> preview </since_tizen>
32         [Obsolete("This has been deprecated in API12")]
33         public int X;
34
35         /// <summary>
36         /// Location along the vertical axis.
37         /// </summary>
38         /// <since_tizen> preview </since_tizen>
39         [Obsolete("This has been deprecated in API12")]
40         public int Y;
41
42         /// <summary>
43         /// A human readable representation of <see cref="Point"/>.
44         /// </summary>
45         /// <returns>The string is formatted as "{{X={0} Y={1}}}".</returns>
46         /// <since_tizen> preview </since_tizen>
47         [Obsolete("This has been deprecated in API12")]
48         public override string ToString()
49         {
50             return string.Format("{{X={0} Y={1}}}", X, Y);
51         }
52
53         /// <summary>
54         /// Gets the hash code.
55         /// </summary>
56         /// <returns>The hash code.</returns>
57         /// <since_tizen> preview </since_tizen>
58         [Obsolete("This has been deprecated in API12")]
59         public override int GetHashCode()
60         {
61             unchecked
62             {
63                 return X.GetHashCode() ^ (Y.GetHashCode() * 397);
64             }
65         }
66
67         /// <summary>
68         /// Indicates whether this instance and a specified object are equal.
69         /// </summary>
70         /// <param name="obj">The object to compare with the current instance.</param>
71         /// <returns>
72         /// true if the object and this instance are of the same type and represent the same value,
73         /// otherwise false.
74         /// </returns>
75         /// <since_tizen> preview </since_tizen>
76         [Obsolete("This has been deprecated in API12")]
77         public override bool Equals(object obj)
78         {
79             if (!(obj is Point))
80                 return false;
81
82             return Equals((Point)obj);
83         }
84
85         /// <summary>
86         /// Indicates whether this instance and a <see cref="Point"/> object are equal.
87         /// </summary>
88         /// <param name="other">The <see cref="Point"/> to compare with the current instance.</param>
89         /// <returns>
90         /// true if the object and this instance are the same type and represent the same value,
91         /// otherwise false.
92         /// </returns>
93         /// <since_tizen> preview </since_tizen>
94         [Obsolete("This has been deprecated in API12")]
95         public bool Equals(Point other)
96         {
97             return X.Equals(other.X) && Y.Equals(other.Y);
98         }
99
100         /// <summary>
101         /// Whether both <see cref="Point"/>s are equal.
102         /// </summary>
103         /// <param name="p1">A <see cref="Point"/> on the left hand side.</param>
104         /// <param name="p2">A <see cref="Point"/> on the right hand side.</param>
105         /// <returns>True if both <see cref="Point"/>s have equal values.</returns>
106         /// <since_tizen> preview </since_tizen>
107         [Obsolete("This has been deprecated in API12")]
108         public static bool operator ==(Point p1, Point p2)
109         {
110             return p1.Equals(p2);
111         }
112
113         /// <summary>
114         /// Whether both <see cref="Point"/>s are not equal.
115         /// </summary>
116         /// <param name="p1">A <see cref="Point"/> on the left hand side.</param>
117         /// <param name="p2">A <see cref="Point"/> on the right hand side.</param>
118         /// <returns>True if both <see cref="Point"/>s do not have equal values.</returns>
119         /// <since_tizen> preview </since_tizen>
120         [Obsolete("This has been deprecated in API12")]
121         public static bool operator !=(Point p1, Point p2)
122         {
123             return !p1.Equals(p2);
124         }
125     }
126 }