Modify documentation of APIs
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / Geocoordinates.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 Tizen.Maps
20 {
21     /// <summary>
22     /// Class representing geographical coordinates.
23     /// </summary>
24     public class Geocoordinates : IDisposable
25     {
26         internal Interop.CoordinatesHandle handle;
27
28         /// <summary>
29         /// Constructs map coordinate object.
30         /// </summary>
31         /// <param name="latitude">Latitude value, must be between (-90.0 ~ 90.0) degrees</param>
32         /// <param name="longitude">Longitude value, must be between (-180.0 ~ 180.0) degrees</param>
33         /// <exception cref="System.ArgumentException">Thrown when values for latitude and longitude are not valid.</exception>
34         /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
35         public Geocoordinates(double latitude, double longitude)
36         {
37             handle = new Interop.CoordinatesHandle(latitude, longitude);
38         }
39
40         internal Geocoordinates(Interop.CoordinatesHandle nativeHandle)
41         {
42             handle = nativeHandle;
43         }
44
45         /// <summary>
46         /// Gets latitude of the coordinates.
47         /// </summary>
48         public double Latitude
49         {
50             get
51             {
52                 return handle.Latitude;
53             }
54         }
55
56         /// <summary>
57         /// Gets longitude of the coordinates.
58         /// </summary>
59         public double Longitude
60         {
61             get
62             {
63                 return handle.Longitude;
64             }
65         }
66
67         /// <summary>
68         /// Returns a string that represents this object.
69         /// </summary>
70         public override string ToString()
71         {
72             return $"[{Latitude}, {Longitude}]";
73         }
74
75         #region IDisposable Support
76         private bool _disposedValue = false;
77
78         protected virtual void Dispose(bool disposing)
79         {
80             if (!_disposedValue)
81             {
82                 handle.Dispose();
83                 _disposedValue = true;
84             }
85         }
86
87         /// <summary>
88         /// Releases all resources used by this object.
89         /// </summary>
90         public void Dispose()
91         {
92             Dispose(true);
93             GC.SuppressFinalize(this);
94         }
95         #endregion
96     }
97 }