internal OverlayHandle(CoordinatesHandle coordinates, EvasObject viewObject, ViewOverlayType type) : base(IntPtr.Zero, true) { var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates); CreateOverlay(clonedCoordinatesHandle, viewObject, type, out handle).ThrowIfFailed("Failed to create native overlay handle"); clonedCoordinatesHandle.HasOwnership = false; }
internal MarkerHandle(CoordinatesHandle coordinates, string imagePath, ViewMarkerType type) : base(IntPtr.Zero, true) { var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates); CreateMarker(clonedCoordinatesHandle, imagePath, type, out handle).ThrowIfFailed("Failed to create native handle for marker"); clonedCoordinatesHandle.HasOwnership = false; }
internal void ForEach(Action <CoordinatesHandle> action) { CoordinatesCallback callback = (index, handle, userData) => { action(CoordinatesHandle.CloneFrom(handle)); return(true); }; Foreach(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get coordinates list from native handle"); }
internal void Add(CoordinatesHandle handleToAdd) { using (var clonedHandle = CoordinatesHandle.CloneFrom(handleToAdd)) { if (this.Append(clonedHandle).WarnIfFailed("Failed to add coordinates to the list")) { clonedHandle.HasOwnership = false; } } }
internal void ForeachPath(Action <CoordinatesHandle> action) { PathCallback callback = (index, total, nativeHandle, userData) => { if (handle != IntPtr.Zero) { action(CoordinatesHandle.CloneFrom(nativeHandle)); //Destroy(nativeHandle); } return(true); }; ForeachPath(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get path coordinates list from native handle"); }