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 /// Class representing geographical area
24 public class Area : IDisposable
26 internal Interop.AreaHandle handle;
29 /// Constructs rectangular area.
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)
38 handle = new Interop.AreaHandle(topLeft?.handle, bottomRight?.handle);
42 /// Constructs circular area.
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)
51 handle = new Interop.AreaHandle(center?.handle, radius);
54 internal Area(Interop.AreaHandle nativeHandle)
56 handle = nativeHandle;
59 #region IDisposable Support
60 private bool _disposedValue = false;
62 protected virtual void Dispose(bool disposing)
67 _disposedValue = true;
72 /// Releases all resources used by this object.
77 GC.SuppressFinalize(this);