[Maps] Fix build warnings #2
[platform/core/csapi/tizenfx.git] / src / Tizen.Maps / Tizen.Maps / MapGestureEventArgs.cs
index 8cccd8f..ba7789b 100755 (executable)
@@ -19,44 +19,59 @@ using ElmSharp;
 
 namespace Tizen.Maps
 {
+    /// <summary>
+    /// Event arguments for gesture type map events.
+    /// </summary>
+    /// <since_tizen> 3 </since_tizen>
     public class MapGestureEventArgs : EventArgs
     {
-        internal static MapGestureEventArgs Create(IntPtr nativeHandle)
+        internal MapGestureEventArgs(IntPtr nativeHandle)
         {
-            Interop.ViewGesture type;
-            Point screenCoordinate = new Point();
-            int touchCount;
-            double zoomFactor;
-            double rotationAngle;
-            Geocoordinates coordinates;
-
-            Interop.ViewEventData.GetGestureType(nativeHandle, out type);
-            Interop.ViewEventData.GetPosition(nativeHandle, out screenCoordinate.X, out screenCoordinate.Y);
-            Interop.ViewEventData.GetFingers(nativeHandle, out touchCount);
-            Interop.ViewEventData.GetZoomFactor(nativeHandle, out zoomFactor);
-            Interop.ViewEventData.GetRotationAngle(nativeHandle, out rotationAngle);
-
-            IntPtr coordinate;
-            Interop.ViewEventData.GetCoordinates(nativeHandle, out coordinate);
-            coordinates = new Geocoordinates(coordinate);
-            return new MapGestureEventArgs((GestureType)type, screenCoordinate, coordinates, touchCount, zoomFactor, rotationAngle);
-        }
-
-        internal MapGestureEventArgs(GestureType type, Point screenCoordinate, Geocoordinates geocoordinates, int touchCount, double zoomFactor, double rotationAngle)
-        {
-            GestureType = type;
-            Position = screenCoordinate;
-            Geocoordinates = geocoordinates;
-            TouchCount = touchCount;
-            ZoomFactor = zoomFactor;
-            RotationAngle = rotationAngle;
+            using (var handle = new Interop.GestureEventDataHandle(nativeHandle))
+            {
+                GestureType = (GestureType)handle.GestureType;
+                Position = handle.Position;
+                TouchCount = handle.FingerCount;
+                ZoomFactor = handle.ZoomFactor;
+                RotationAngle = handle.RotationAngle;
+                Geocoordinates = new Geocoordinates(handle.Coordinates);
+            }
         }
 
+        /// <summary>
+        /// Gets the type of gesture event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public GestureType GestureType { get; }
+
+        /// <summary>
+        /// Gets screen coordinates in the event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public Point Position { get; }
+
+        /// <summary>
+        /// Gets the number of fingers detected in the event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public int TouchCount { get; }
+
+        /// <summary>
+        /// Gets the zoom factor for zoom gesture event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public double ZoomFactor { get; }
+
+        /// <summary>
+        /// Gets the angle of rotation for rotate gesture event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public double RotationAngle { get; }
+
+        /// <summary>
+        /// Gets the geographical coordinates for the event.
+        /// </summary>
+        /// <since_tizen> 3 </since_tizen>
         public Geocoordinates Geocoordinates { get; }
     }
 }