Modify documentation of APIs
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / Area.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 area
23     /// </summary>
24     public class Area : IDisposable
25     {
26         internal Interop.AreaHandle handle;
27
28         /// <summary>
29         /// Constructs rectangular area.
30         /// </summary>
31         /// <param name="topLeft">Top left coordinate of the area</param>
32         /// <param name="bottomRight">Bottom left coordinate of the area</param>
33         /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
34         /// <exception cref="System.ArgumentException">Thrown when input coordinates are invalid</exception>
35         /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
36         public Area(Geocoordinates topLeft, Geocoordinates bottomRight)
37         {
38             handle = new Interop.AreaHandle(topLeft?.handle, bottomRight?.handle);
39         }
40
41         /// <summary>
42         /// Constructs circular area.
43         /// </summary>
44         /// <param name="center">Coordinate for center of the area</param>
45         /// <param name="radius">Radius of the area</param>
46         /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
47         /// <exception cref="System.ArgumentException">Thrown when input coordinates are invalid</exception>
48         /// <exception cref="System.InvalidOperationException">Thrown when native operation failed to allocate memory.</exception>
49         public Area(Geocoordinates center, double radius)
50         {
51             handle = new Interop.AreaHandle(center?.handle, radius);
52         }
53
54         internal Area(Interop.AreaHandle nativeHandle)
55         {
56             handle = nativeHandle;
57         }
58
59         #region IDisposable Support
60         private bool _disposedValue = false;
61
62         protected virtual void Dispose(bool disposing)
63         {
64             if (!_disposedValue)
65             {
66                 handle.Dispose();
67                 _disposedValue = true;
68             }
69         }
70
71         /// <summary>
72         /// Releases all resources used by this object.
73         /// </summary>
74         public void Dispose()
75         {
76             Dispose(true);
77             GC.SuppressFinalize(this);
78         }
79         #endregion
80     }
81 }