X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Finternal%2FAnimatablePropertyRegistration.cs;h=71956fb3b15942aca678ba75e246ed39a5a011b0;hb=46b8a31f5c1c75a22b648ca394a4de8a50898513;hp=5d613fb0e2b504f6fff5db4b07496df151477b45;hpb=332fe07c0cfdf7e7ac18267e0e100338f3e214e0;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/internal/AnimatablePropertyRegistration.cs b/src/Tizen.NUI/src/internal/AnimatablePropertyRegistration.cs index 5d613fb..71956fb 100755 --- a/src/Tizen.NUI/src/internal/AnimatablePropertyRegistration.cs +++ b/src/Tizen.NUI/src/internal/AnimatablePropertyRegistration.cs @@ -17,8 +17,7 @@ namespace Tizen.NUI { - - internal class AnimatablePropertyRegistration : global::System.IDisposable + internal class AnimatablePropertyRegistration : Disposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; @@ -34,54 +33,13 @@ namespace Tizen.NUI return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~AnimatablePropertyRegistration() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) + protected override void Dispose(DisposeTypes type) { 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. @@ -91,25 +49,22 @@ namespace Tizen.NUI if (swigCMemOwn) { swigCMemOwn = false; - NDalicPINVOKE.delete_AnimatablePropertyRegistration(swigCPtr); + Interop.NDalic.delete_AnimatablePropertyRegistration(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - disposed = true; + base.Dispose(type); } - - public AnimatablePropertyRegistration(TypeRegistration registered, string name, int index, PropertyType type) : this(NDalicPINVOKE.new_AnimatablePropertyRegistration__SWIG_0(TypeRegistration.getCPtr(registered), name, index, (int)type), true) + public AnimatablePropertyRegistration(TypeRegistration registered, string name, int index, PropertyType type) : this(Interop.NDalic.new_AnimatablePropertyRegistration__SWIG_0(TypeRegistration.getCPtr(registered), name, index, (int)type), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public AnimatablePropertyRegistration(TypeRegistration registered, string name, int index, PropertyValue value) : this(NDalicPINVOKE.new_AnimatablePropertyRegistration__SWIG_1(TypeRegistration.getCPtr(registered), name, index, PropertyValue.getCPtr(value)), true) + public AnimatablePropertyRegistration(TypeRegistration registered, string name, int index, PropertyValue value) : this(Interop.NDalic.new_AnimatablePropertyRegistration__SWIG_1(TypeRegistration.getCPtr(registered), name, index, PropertyValue.getCPtr(value)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - }