}
private DaliEventHandler<object, DetectedEventArgs> detectedEventHandler;
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void DetectedCallbackType(IntPtr actor, IntPtr longPressGesture);
private DetectedCallbackType detectedCallback;
return ret;
}
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGestureDetector obj)
+ /// <summary>
+ /// override it to clean-up your own resources.
+ /// </summary>
+ /// <param name="type"></param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(DisposeTypes type)
{
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+ }
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+
+ if (HasBody())
+ {
+ if (detectedCallback != null)
+ {
+ using LongPressGestureDetectedSignal signal = new LongPressGestureDetectedSignal(Interop.LongPressGestureDetector.DetectedSignal(GetBaseHandleCPtrHandleRef), false);
+ signal?.Disconnect(detectedCallback);
+ detectedCallback = null;
+ }
+ }
+ base.Dispose(type);
}
/// This will not be public opened.
[EditorBrowsable(EditorBrowsableState.Never)]
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
{
- if (detectedEventHandler == null && DetectedSignal().Empty() == false)
- {
- DetectedSignal().Disconnect(detectedCallback);
- }
Interop.LongPressGestureDetector.DeleteLongPressGestureDetector(swigCPtr);
}
e.View = Registry.GetManagedBaseHandleFromRefObject(actor) as View;
}
+ // If DispatchGestureEvents is false, no gesture events are dispatched.
+ if (e.View != null && e.View.DispatchGestureEvents == false)
+ {
+ return;
+ }
+
e.LongPressGesture = Tizen.NUI.LongPressGesture.GetLongPressGestureFromPtr(longPressGesture);
if (detectedEventHandler != null)
{
private View view;
private LongPressGesture longPressGesture;
+ private bool handled = true;
/// <summary>
/// View the attached view.
longPressGesture = value;
}
}
+
+ /// <summary>
+ /// Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool Handled
+ {
+ get => handled;
+ set
+ {
+ handled = value;
+ Interop.Actor.SetNeedGesturePropagation(View.getCPtr(view), !value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
}
}
}