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 class representing a geographical area.
24 /// <since_tizen> 3 </since_tizen>
25 public class Area : IDisposable
27 internal Interop.AreaHandle handle;
30 /// Constructs a rectangular area.
32 /// <since_tizen> 3 </since_tizen>
33 /// <param name="topLeft">Top-left coordinates of the area.</param>
34 /// <param name="bottomRight">Bottom-left coordinates of the area.</param>
35 /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
36 /// <exception cref="System.ArgumentException">Thrown when input coordinates are invalid.</exception>
37 /// <exception cref="System.InvalidOperationException">Thrown when a native operation fails to allocate memory.</exception>
38 public Area(Geocoordinates topLeft, Geocoordinates bottomRight)
40 handle = new Interop.AreaHandle(topLeft?.handle, bottomRight?.handle);
44 /// Constructs a circular area.
46 /// <since_tizen> 3 </since_tizen>
47 /// <param name="center">Coordinates for center of the area.</param>
48 /// <param name="radius">Radius of the area.</param>
49 /// <exception cref="System.NotSupportedException">Thrown when the required feature is not supported.</exception>
50 /// <exception cref="System.ArgumentException">Thrown when input coordinates are invalid.</exception>
51 /// <exception cref="System.InvalidOperationException">Thrown when a native operation fails to allocate memory.</exception>
52 public Area(Geocoordinates center, double radius)
54 handle = new Interop.AreaHandle(center?.handle, radius);
57 internal Area(Interop.AreaHandle nativeHandle)
59 handle = nativeHandle;
62 #region IDisposable Support
63 private bool _disposedValue = false;
65 protected virtual void Dispose(bool disposing)
70 _disposedValue = true;
75 /// Releases all the resources used by this object.
77 /// <since_tizen> 3 </since_tizen>
81 GC.SuppressFinalize(this);