private void DirectorOnSizeAnimation(global::System.IntPtr animation, global::System.IntPtr targetSize)
{
- var ani = new Animation(animation, true);
+ bool useRegisterAnimation = false;
+
+ var ani = Registry.GetManagedBaseHandleFromNativePtr(animation) as Animation;
+ if (ani != null)
+ {
+ HandleRef CPtr = new HandleRef(this, animation);
+ Interop.BaseHandle.DeleteBaseHandle(CPtr);
+ CPtr = new HandleRef(null, global::System.IntPtr.Zero);
+
+ useRegisterAnimation = true;
+ }
+ else
+ {
+ ani = new Animation(animation, true);
+ }
var vector3 = new Vector3(targetSize, false);
OnSizeAnimation?.Invoke(ani, vector3);
- ani.Dispose();
vector3.Dispose();
+
+ // Dispose only if we create new Animation here.
+ if (!useRegisterAnimation)
+ {
+ ani.Dispose();
+ }
}
private bool DirectorOnKey(global::System.IntPtr arg0)
private void DirectorOnStyleChange(global::System.IntPtr styleManager, int change)
{
- var styleManger = new StyleManager(styleManager, true);
- OnStyleChange?.Invoke(styleManger, (StyleChangeType)change);
- styleManger.Dispose();
+ bool useRegisterStyleManager = false;
+
+ var nuiStyleManger = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
+ if (nuiStyleManger != null)
+ {
+ HandleRef CPtr = new HandleRef(this, styleManager);
+ Interop.BaseHandle.DeleteBaseHandle(CPtr);
+ CPtr = new HandleRef(null, global::System.IntPtr.Zero);
+
+ useRegisterStyleManager = true;
+ }
+ else
+ {
+ nuiStyleManger = new StyleManager(styleManager, true);
+ }
+ OnStyleChange?.Invoke(nuiStyleManger, (StyleChangeType)change);
+
+ // Dispose only if we create new StyleManager here.
+ if (!useRegisterStyleManager)
+ {
+ nuiStyleManger.Dispose();
+ }
}
private bool DirectorOnAccessibilityActivated()
private bool DirectorOnAccessibilityPan(global::System.IntPtr gesture)
{
- var panGesture = new PanGesture(gesture, true);
+ // Take memory ownership, but do not register into Registry.
+ var panGesture = new PanGesture(gesture, true, false);
var ret = OnAccessibilityPan?.Invoke(panGesture) ?? false;
panGesture.Dispose();
return ret;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
+ {
+ }
+
+ internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
+ {
+ }
+
+ internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.PanGestureDetector.PanGestureUpcast(cPtr), cMemoryOwn)
+ internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(Interop.PanGestureDetector.PanGestureUpcast(cPtr), cMemoryOwn, cMemoryOwn)
+ {
+ }
+
+ internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(Interop.PanGestureDetector.PanGestureUpcast(cPtr), cMemoryOwn, cRegister)
{
}
/// <since_tizen> 3 </since_tizen>
public class PinchGesture : Gesture
{
- internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
+ {
+ }
+
+ internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
public class RotationGesture : Gesture
{
+ internal RotationGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
+ {
+ }
- internal RotationGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ internal RotationGesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
+ {
+ }
+
+ internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
{
}