namespace Tizen.NUI
{
-
- internal class CustomAlgorithmInterface : global::System.IDisposable
+ internal class CustomAlgorithmInterface : Disposable
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;
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;
-
-
- ~CustomAlgorithmInterface()
- {
- 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.
if (swigCMemOwn)
{
swigCMemOwn = false;
- NDalicPINVOKE.delete_CustomAlgorithmInterface(swigCPtr);
+ Interop.CustomAlgorithmInterface.delete_CustomAlgorithmInterface(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
- disposed = true;
+ base.Dispose(type);
}
public virtual View GetNextFocusableView(View current, View proposed, View.FocusDirection direction)
{
- View ret = new View(NDalicPINVOKE.CustomAlgorithmInterface_GetNextFocusableActor(swigCPtr, View.getCPtr(current), View.getCPtr(proposed), (int)direction), true);
+ View ret = new View(Interop.CustomAlgorithmInterface.CustomAlgorithmInterface_GetNextFocusableActor(swigCPtr, View.getCPtr(current), View.getCPtr(proposed), (int)direction), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal CustomAlgorithmInterface() : this(NDalicPINVOKE.new_CustomAlgorithmInterface(), true)
+ internal CustomAlgorithmInterface() : this(Interop.CustomAlgorithmInterface.new_CustomAlgorithmInterface(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
SwigDirectorConnect();
{
if (SwigDerivedClassHasMethod("GetNextFocusableView", swigMethodTypes0))
swigDelegate0 = new SwigDelegateCustomAlgorithmInterface_0(SwigDirectorGetNextFocusableView);
- NDalicPINVOKE.CustomAlgorithmInterface_director_connect(swigCPtr, swigDelegate0);
+ Interop.CustomAlgorithmInterface.CustomAlgorithmInterface_director_connect(swigCPtr, swigDelegate0);
}
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(View), typeof(View), typeof(View.FocusDirection) };
}
-
}