Revert "[Tizen] Fixed many issues."
authorminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:18:17 +0000 (10:18 +0900)
committerminho.sun <minho.sun@samsung.com>
Tue, 1 Aug 2017 01:18:20 +0000 (10:18 +0900)
This reverts commit 4b95182bd6417879064ca23e82547bae81447b5e.

Change-Id: Id203c68e81869d4e27820a7f9bfe40e66aa18bd1

54 files changed:
src/Tizen.NUI/src/internal/Alignment.cs
src/Tizen.NUI/src/internal/AsyncImageLoader.cs
src/Tizen.NUI/src/internal/BufferImage.cs
src/Tizen.NUI/src/internal/Builder.cs
src/Tizen.NUI/src/internal/Camera.cs
src/Tizen.NUI/src/internal/CustomActor.cs
src/Tizen.NUI/src/internal/EncodedBufferImage.cs
src/Tizen.NUI/src/internal/FrameBuffer.cs
src/Tizen.NUI/src/internal/FrameBufferImage.cs
src/Tizen.NUI/src/internal/GaussianBlurView.cs
src/Tizen.NUI/src/internal/GestureDetector.cs
src/Tizen.NUI/src/internal/Image.cs
src/Tizen.NUI/src/internal/ItemView.cs
src/Tizen.NUI/src/internal/LinearConstrainer.cs
src/Tizen.NUI/src/internal/LongPressGestureDetector.cs
src/Tizen.NUI/src/internal/Model3dView.cs
src/Tizen.NUI/src/internal/NativeImage.cs
src/Tizen.NUI/src/internal/PageTurnLandscapeView.cs
src/Tizen.NUI/src/internal/PageTurnPortraitView.cs
src/Tizen.NUI/src/internal/PageTurnView.cs
src/Tizen.NUI/src/internal/PanGestureDetector.cs
src/Tizen.NUI/src/internal/PathConstrainer.cs
src/Tizen.NUI/src/internal/PinchGestureDetector.cs
src/Tizen.NUI/src/internal/PropertyNotification.cs
src/Tizen.NUI/src/internal/RenderTask.cs
src/Tizen.NUI/src/internal/RenderTaskList.cs
src/Tizen.NUI/src/internal/ScrollViewPagePathEffect.cs
src/Tizen.NUI/src/internal/TapGestureDetector.cs
src/Tizen.NUI/src/internal/TouchPoint.cs
src/Tizen.NUI/src/internal/ViewImpl.cs
src/Tizen.NUI/src/internal/ViewWrapperImpl.cs
src/Tizen.NUI/src/public/Animation.cs
src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
src/Tizen.NUI/src/public/BaseComponents/TableView.cs
src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs
src/Tizen.NUI/src/public/BaseComponents/TextField.cs
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs
src/Tizen.NUI/src/public/BaseComponents/VideoView.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/BaseComponents/VisualView.cs
src/Tizen.NUI/src/public/CustomView/Spin.cs
src/Tizen.NUI/src/public/KeyFrames.cs
src/Tizen.NUI/src/public/Layer.cs
src/Tizen.NUI/src/public/Path.cs
src/Tizen.NUI/src/public/Renderer.cs
src/Tizen.NUI/src/public/TextureSet.cs
src/Tizen.NUI/src/public/Timer.cs
src/Tizen.NUI/src/public/Touch.cs
src/Tizen.NUI/src/public/UIComponents/Popup.cs
src/Tizen.NUI/src/public/UIComponents/PushButton.cs
src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs
src/Tizen.NUI/src/public/UIComponents/Slider.cs
src/Tizen.NUI/src/public/VisualFactory.cs
src/Tizen.NUI/src/public/Window.cs

index c49d4f7..e64520e 100755 (executable)
@@ -242,7 +242,7 @@ namespace Tizen.NUI
 
         public new static Alignment DownCast(BaseHandle handle)
         {
-            Alignment ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Alignment;
+            Alignment ret = new Alignment(NDalicPINVOKE.Alignment_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d01e131..f3f122d 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI
 
         public static AsyncImageLoader DownCast(BaseHandle handle)
         {
-            AsyncImageLoader ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as AsyncImageLoader;
+            AsyncImageLoader ret = new AsyncImageLoader(NDalicPINVOKE.AsyncImageLoader_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 0f15466..0db41cf 100755 (executable)
@@ -93,7 +93,7 @@ namespace Tizen.NUI
         }
         public new static BufferImage DownCast(BaseHandle handle)
         {
-            BufferImage ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as BufferImage;
+            BufferImage ret = new BufferImage(NDalicPINVOKE.BufferImage_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index aaa87be..b826f65 100755 (executable)
@@ -218,9 +218,9 @@ namespace Tizen.NUI
             return ret;
         }
 
-        public View Create(string templateName)
+        public BaseHandle Create(string templateName)
         {
-            View ret = new View(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true);
+            BaseHandle ret = new BaseHandle(NDalicPINVOKE.Builder_Create__SWIG_0(swigCPtr, templateName), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index f43ba7f..7f98d94 100755 (executable)
@@ -181,7 +181,7 @@ namespace Tizen.NUI
         }
         public new static Camera DownCast(BaseHandle handle)
         {
-            Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
+            Camera ret = new Camera(NDalicPINVOKE.CameraActor_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 6f7bf4d..8bea2d1 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
 
         public new static CustomActor DownCast(BaseHandle handle)
         {
-            CustomActor ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as CustomActor;
+            CustomActor ret = new CustomActor(NDalicPINVOKE.CustomActor_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 4019bc6..6f801c7 100755 (executable)
@@ -80,7 +80,7 @@ namespace Tizen.NUI
         }
         public new static EncodedBufferImage DownCast(BaseHandle handle)
         {
-            EncodedBufferImage ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as EncodedBufferImage;
+            EncodedBufferImage ret = new EncodedBufferImage(NDalicPINVOKE.EncodedBufferImage_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 1db1867..aba063a 100755 (executable)
@@ -94,9 +94,7 @@ namespace Tizen.NUI
 
         public Texture GetColorTexture()
         {
-            global::System.IntPtr cPtr = NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr);
-            Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
-
+            Texture ret = new Texture(NDalicPINVOKE.FrameBuffer_GetColorTexture(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7cc5961..3646b8a 100755 (executable)
@@ -97,7 +97,7 @@ namespace Tizen.NUI
         }
         public new static FrameBufferImage DownCast(BaseHandle handle)
         {
-            FrameBufferImage ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as FrameBufferImage;
+            FrameBufferImage ret = new FrameBufferImage(NDalicPINVOKE.FrameBufferImage_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 306c597..b9e2cdd 100755 (executable)
@@ -168,7 +168,7 @@ namespace Tizen.NUI
 
         public new static GaussianBlurView DownCast(BaseHandle handle)
         {
-            GaussianBlurView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as GaussianBlurView;
+            GaussianBlurView ret = new GaussianBlurView(NDalicPINVOKE.GaussianBlurView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a9e8217..faf27a3 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
 
         public new static GestureDetector DownCast(BaseHandle handle)
         {
-            GestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as GestureDetector;
+            GestureDetector ret = new GestureDetector(NDalicPINVOKE.GestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 928305a..af70862 100755 (executable)
@@ -177,7 +177,7 @@ namespace Tizen.NUI
 
         public static Image DownCast(BaseHandle handle)
         {
-            Image ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Image;
+            Image ret = new Image(NDalicPINVOKE.Image_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index ad354db..ab4fc20 100755 (executable)
@@ -107,7 +107,7 @@ namespace Tizen.NUI
 
         internal new static ItemView DownCast(BaseHandle handle)
         {
-            ItemView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ItemView;
+            ItemView ret = new ItemView(NDalicPINVOKE.ItemView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 5a21f4c..6004eb0 100755 (executable)
@@ -162,7 +162,7 @@ namespace Tizen.NUI
         }
         internal new static LinearConstrainer DownCast(BaseHandle handle)
         {
-            LinearConstrainer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer;
+            LinearConstrainer ret = new LinearConstrainer(NDalicPINVOKE.LinearConstrainer_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a168ca7..2262b85 100755 (executable)
@@ -177,7 +177,7 @@ namespace Tizen.NUI
         }
         public new static LongPressGestureDetector DownCast(BaseHandle handle)
         {
-            LongPressGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as LongPressGestureDetector;
+            LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.LongPressGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index cb053aa..b7e274b 100755 (executable)
@@ -187,7 +187,7 @@ namespace Tizen.NUI
 
         public new static Model3dView DownCast(BaseHandle handle)
         {
-            Model3dView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
+            Model3dView ret = new Model3dView(NDalicPINVOKE.Model3dView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a3a6183..8303c3f 100755 (executable)
@@ -89,7 +89,7 @@ namespace Tizen.NUI
 
         public new static NativeImage DownCast(BaseHandle handle)
         {
-            NativeImage ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as NativeImage;
+            NativeImage ret = new NativeImage(NDalicPINVOKE.NativeImage_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d2e501b..84bba07 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI
 
         public new static PageTurnLandscapeView DownCast(BaseHandle handle)
         {
-            PageTurnLandscapeView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnLandscapeView;
+            PageTurnLandscapeView ret = new PageTurnLandscapeView(NDalicPINVOKE.PageTurnLandscapeView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 607b476..0d2c174 100755 (executable)
@@ -82,7 +82,7 @@ namespace Tizen.NUI
 
         public new static PageTurnPortraitView DownCast(BaseHandle handle)
         {
-            PageTurnPortraitView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnPortraitView;
+            PageTurnPortraitView ret = new PageTurnPortraitView(NDalicPINVOKE.PageTurnPortraitView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 9a2ebbe..1203013 100755 (executable)
@@ -524,7 +524,7 @@ namespace Tizen.NUI
 
         public new static PageTurnView DownCast(BaseHandle handle)
         {
-            PageTurnView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PageTurnView;
+            PageTurnView ret = new PageTurnView(NDalicPINVOKE.PageTurnView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 2573744..178b6c2 100755 (executable)
@@ -343,7 +343,7 @@ namespace Tizen.NUI
         }
         public new static PanGestureDetector DownCast(BaseHandle handle)
         {
-            PanGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector;
+            PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 98e2d9e..9abb448 100755 (executable)
@@ -166,7 +166,7 @@ namespace Tizen.NUI
         }
         public new static PathConstrainer DownCast(BaseHandle handle)
         {
-            PathConstrainer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer;
+            PathConstrainer ret = new PathConstrainer(NDalicPINVOKE.PathConstrainer_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 449509f..34c31c7 100755 (executable)
@@ -170,7 +170,7 @@ namespace Tizen.NUI
         }
         public new static PinchGestureDetector DownCast(BaseHandle handle)
         {
-            PinchGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector;
+            PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 50dc344..d084ca1 100755 (executable)
@@ -161,7 +161,7 @@ namespace Tizen.NUI
 
         public static PropertyNotification DownCast(BaseHandle handle)
         {
-            PropertyNotification ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PropertyNotification;
+            PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.PropertyNotification_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index babb0ed..4964701 100755 (executable)
@@ -256,7 +256,7 @@ namespace Tizen.NUI
 
         public new static RenderTask DownCast(BaseHandle handle)
         {
-            RenderTask ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask;
+            RenderTask ret = new RenderTask(NDalicPINVOKE.RenderTask_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 2c82275..250ba24 100755 (executable)
@@ -71,7 +71,7 @@ namespace Tizen.NUI
 
         public static RenderTaskList DownCast(BaseHandle handle)
         {
-            RenderTaskList ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTaskList;
+            RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.RenderTaskList_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d710aa8..7912eca 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
         }
         public static ScrollViewPagePathEffect DownCast(BaseHandle handle)
         {
-            ScrollViewPagePathEffect ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollViewPagePathEffect;
+            ScrollViewPagePathEffect ret = new ScrollViewPagePathEffect(NDalicPINVOKE.ScrollViewPagePathEffect_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a3c9c6e..a5908c4 100755 (executable)
@@ -172,7 +172,7 @@ namespace Tizen.NUI
         }
         public new static TapGestureDetector DownCast(BaseHandle handle)
         {
-            TapGestureDetector ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TapGestureDetector;
+            TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 956a3c6..03da8fd 100755 (executable)
@@ -151,7 +151,7 @@ namespace Tizen.NUI
             get
             {
                 global::System.IntPtr cPtr = NDalicPINVOKE.TouchPoint_hitActor_get(swigCPtr);
-                View ret = (cPtr == global::System.IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromRefObject(cPtr) as View;
+                View ret = (cPtr == global::System.IntPtr.Zero) ? null : new View(cPtr, false);
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 return ret;
             }
index aea5d39..1f3da0a 100755 (executable)
@@ -616,22 +616,12 @@ namespace Tizen.NUI
 
         private void SwigDirectorOnChildAdd(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-
-            if (view)
-            {
-                OnChildAdd(view);
-            }
+            OnChildAdd(new View(child, false));
         }
 
         private void SwigDirectorOnChildRemove(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-
-            if (view)
-            {
-                OnChildRemove(view);
-            }
+            OnChildRemove(new View(child, false));
         }
 
         private void SwigDirectorOnPropertySet(int index, global::System.IntPtr propertyValue)
@@ -686,12 +676,7 @@ namespace Tizen.NUI
 
         private float SwigDirectorCalculateChildSize(global::System.IntPtr child, int dimension)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                return CalculateChildSize(view, (DimensionType)dimension);
-            }
-            return 0.0f;
+            return CalculateChildSize(new View(child, false), (DimensionType)dimension);
         }
 
         private float SwigDirectorGetHeightForWidth(float width)
@@ -731,29 +716,17 @@ namespace Tizen.NUI
 
         private void SwigDirectorOnControlChildAdd(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                OnControlChildAdd(view);
-            }
+            OnControlChildAdd(new View(child, false));
         }
 
         private void SwigDirectorOnControlChildRemove(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                OnControlChildRemove(view);
-            }
+            OnControlChildRemove(new View(child, false));
         }
 
         private void SwigDirectorOnStyleChange(global::System.IntPtr styleManager, int change)
         {
-            StyleManager stManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager;
-            if (stManager)
-            {
-                OnStyleChange(stManager, (StyleChangeType)change);
-            }
+            OnStyleChange(new StyleManager(styleManager, true), (StyleChangeType)change);
         }
 
         private bool SwigDirectorOnAccessibilityActivated()
@@ -793,12 +766,12 @@ namespace Tizen.NUI
 
         private global::System.IntPtr SwigDirectorGetNextKeyboardFocusableView(global::System.IntPtr currentFocusedView, int direction, bool loopEnabled)
         {
-            return View.getCPtr(GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedView) as View, (View.FocusDirection)direction, loopEnabled)).Handle;
+            return View.getCPtr(GetNextFocusableView(new View(currentFocusedView, true), (View.FocusDirection)direction, loopEnabled)).Handle;
         }
 
         private void SwigDirectorOnKeyboardFocusChangeCommitted(global::System.IntPtr commitedFocusableView)
         {
-            OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View);
+            OnFocusChangeCommitted(new View(commitedFocusableView, true));
         }
 
         private bool SwigDirectorOnKeyboardEnter()
index 94e182e..81489de 100755 (executable)
@@ -214,9 +214,7 @@ namespace Tizen.NUI
 
         public VisualBase GetVisual(int index)
         {
-            System.IntPtr cPtr = NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index);
-            VisualBase ret = Registry.GetManagedBaseHandleFromRefObject(cPtr) as VisualBase;
-
+            VisualBase ret = new VisualBase(NDalicManualPINVOKE.ViewWrapperImpl_GetVisual(swigCPtr, index), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -309,20 +307,12 @@ namespace Tizen.NUI
 
         private void DirectorOnChildAdd(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                OnChildAdd(view);
-            }
+            OnChildAdd(new View(child, false));
         }
 
         private void DirectorOnChildRemove(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                OnChildRemove(view);
-            }
+            OnChildRemove(new View(child, false));
         }
 
         private void DirectorOnPropertySet(int index, global::System.IntPtr propertyValue)
@@ -380,12 +370,7 @@ namespace Tizen.NUI
 
         private float DirectorCalculateChildSize(global::System.IntPtr child, int dimension)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                return CalculateChildSize(view, (DimensionType)dimension);
-            }
-            return 0.0f;
+            return CalculateChildSize(new View(child, false), (DimensionType)dimension);
         }
 
         private float DirectorGetHeightForWidth(float width)
@@ -424,20 +409,12 @@ namespace Tizen.NUI
 
         private void DirectorOnControlChildAdd(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                OnControlChildAdd(view);
-            }
+            OnControlChildAdd(new View(child, false));
         }
 
         private void DirectorOnControlChildRemove(global::System.IntPtr child)
         {
-            View view = Registry.GetManagedBaseHandleFromNativePtr(child) as View;
-            if (view)
-            {
-                OnControlChildRemove(view);
-            }
+            OnControlChildRemove(new View(child, false));
         }
 
         private void DirectorOnStyleChange(global::System.IntPtr styleManager, int change)
@@ -485,20 +462,12 @@ namespace Tizen.NUI
 
         private global::System.IntPtr DirectorGetNextFocusableActor(global::System.IntPtr currentFocusedActor, int direction, bool loopEnabled)
         {
-            View view = GetNextFocusableView(Registry.GetManagedBaseHandleFromNativePtr(currentFocusedActor) as View, (View.FocusDirection)direction, loopEnabled);
-            if (view)
-            {
-                return View.getCPtr(view).Handle;
-            }
-            else
-            {
-                return currentFocusedActor;
-            }
+            return View.getCPtr(GetNextFocusableView(new View(currentFocusedActor, false), (View.FocusDirection)direction, loopEnabled)).Handle;
         }
 
         private void DirectorOnFocusChangeCommitted(global::System.IntPtr commitedFocusableView)
         {
-            OnFocusChangeCommitted(Registry.GetManagedBaseHandleFromNativePtr(commitedFocusableView) as View);
+            OnFocusChangeCommitted(new View(commitedFocusableView, false));
         }
 
         private bool DirectorOnKeyboardEnter()
index 3169ad3..83b129f 100755 (executable)
@@ -767,7 +767,7 @@ namespace Tizen.NUI
         /// <returns>Handle to an Animation object or an uninitialized handle</returns>
         public static Animation DownCast(BaseHandle handle)
         {
-            Animation ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation;
+            Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 5182c4f..27be697 100755 (executable)
@@ -183,7 +183,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static ImageView DownCast(BaseHandle handle)
         {
-            ImageView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView;
+            ImageView ret = new ImageView(NDalicPINVOKE.ImageView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 48b57d3..5744fc0 100755 (executable)
@@ -318,7 +318,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TableView DownCast(BaseHandle handle)
         {
-            TableView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TableView;
+            TableView ret = new TableView(NDalicPINVOKE.TableView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -344,9 +344,7 @@ namespace Tizen.NUI.BaseComponents
         /// <returns>Child that was in the cell or an uninitialized handle</returns>
         public View GetChildAt(TableView.CellPosition position)
         {
-            IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -358,9 +356,7 @@ namespace Tizen.NUI.BaseComponents
         /// <returns>Child that was removed or an uninitialized handle</returns>
         public View RemoveChildAt(TableView.CellPosition position)
         {
-            IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position));
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 288a477..23d3165 100755 (executable)
@@ -315,7 +315,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TextEditor DownCast(BaseHandle handle)
         {
-            TextEditor ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextEditor;
+            TextEditor ret = new TextEditor(NDalicPINVOKE.TextEditor_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index bcf1a09..7b896bc 100755 (executable)
@@ -296,7 +296,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TextField DownCast(BaseHandle handle)
         {
-            TextField ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextField;
+            TextField ret = new TextField(NDalicPINVOKE.TextField_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index fe53cb7..bc794d7 100755 (executable)
@@ -131,7 +131,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static TextLabel DownCast(BaseHandle handle)
         {
-            TextLabel ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel;
+            TextLabel ret = new TextLabel(NDalicPINVOKE.TextLabel_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 0c8e0de..7c380b9 100755 (executable)
@@ -174,7 +174,7 @@ namespace Tizen.NUI.BaseComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static VideoView DownCast(BaseHandle handle)
         {
-            VideoView ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as VideoView;
+            VideoView ret = new VideoView(NDalicPINVOKE.VideoView_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index d0ddfee..7646242 100755 (executable)
@@ -820,21 +820,28 @@ namespace Tizen.NUI.BaseComponents
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        /// <summary>
+        /// Downcasts a handle to View handle.<br>
+        /// If handle points to a View, the downcast produces valid handle.<br>
+        /// If not, the returned handle is left uninitialized.<br>
+        /// </summary>
+        /// <param name="handle">Handle to an object</param>
+        /// <returns>A handle to a View or an uninitialized handle</returns>
+        [Obsolete("Please do not use! this will be deprecated")]
         public new static View DownCast(BaseHandle handle)
         {
-            View ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as View;
+            View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
-        [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")]
+        [Obsolete("Please do not use! this will be deprecated")]
         public static T DownCast<T>(View view) where T : View
         {
-            T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T;
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
             if (ret != null)
             {
-                return ret;
+                return (T)ret;
             }
             return null;
         }
@@ -2014,9 +2021,7 @@ namespace Tizen.NUI.BaseComponents
 
         internal Layer GetLayer()
         {
-            IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr);
-            Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
-
+            Layer ret = new Layer(NDalicPINVOKE.Actor_GetLayer(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
@@ -2714,9 +2719,7 @@ namespace Tizen.NUI.BaseComponents
 
         public Renderer GetRendererAt(uint index)
         {
-            IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index);
-            Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer;
-
+            Renderer ret = new Renderer(NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
index dc36895..f88b1ff 100755 (executable)
@@ -104,7 +104,7 @@ namespace Tizen.NUI.BaseComponents
 
             if (visualIndex > 0)
             {
-                visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap); // Create a visual for the new one.
+                visual = VisualFactory.Get().CreateVisual(visualMap.OutputVisualMap); // Create a visual for the new one.
                 visual.Name = visualName;
                 visual.DepthIndex = visualMap.DepthIndex;
 
@@ -190,7 +190,7 @@ namespace Tizen.NUI.BaseComponents
         {
             VisualBase visual = null;
 
-            visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap);
+            visual = VisualFactory.Get().CreateVisual(visualMap.OutputVisualMap);
             visual.Name = visualName;
             visual.DepthIndex = visualMap.DepthIndex;
 
index cfed4a8..f208769 100755 (executable)
@@ -87,7 +87,7 @@ namespace Tizen.NUI
 
             // Create image visual for the arrow keys
             _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new PropertyValue(_arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite);
-            _arrowVisual = VisualFactory.Instance.CreateVisual(
+            _arrowVisual = VisualFactory.Get().CreateVisual(
                 new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image))
                                  .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage))
                                  .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150))
@@ -187,8 +187,9 @@ namespace Tizen.NUI
             }
             else
             {
-                // Return null
-                return null;
+                // Return a native empty handle as nothing can be focused in the left or right
+                nextFocusedView = new View();
+                nextFocusedView.Reset();
             }
 
             return nextFocusedView;
@@ -377,7 +378,7 @@ namespace Tizen.NUI
             set
             {
                 _arrowImage = value;
-                _arrowVisual = VisualFactory.Instance.CreateVisual(
+                _arrowVisual = VisualFactory.Get().CreateVisual(
                     new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image))
                                  .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage))
                                  .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150))
index 92abafb..8b58ce5 100755 (executable)
@@ -105,7 +105,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public static KeyFrames DownCast(BaseHandle handle)
         {
-            KeyFrames ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as KeyFrames;
+            KeyFrames ret = new KeyFrames(NDalicPINVOKE.KeyFrames_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 17179f8..474146c 100755 (executable)
@@ -103,7 +103,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public new static Layer DownCast(BaseHandle handle)
         {
-            Layer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer;
+            Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -117,9 +117,7 @@ namespace Tizen.NUI
         /// <returns> A handle to the view if found, or an empty handle if not. </returns>
         public View FindChildById(uint id)
         {
-            IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id);
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
index a13eb6a..4090eaa 100755 (executable)
@@ -88,7 +88,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public new static Path DownCast(BaseHandle handle)
         {
-            Path ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Path;
+            Path ret = new Path(NDalicPINVOKE.Path_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 6ff2db2..d875000 100755 (executable)
@@ -107,9 +107,7 @@ namespace Tizen.NUI
 
         public Geometry GetGeometry()
         {
-            System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr);
-            Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Geometry;
-
+            Geometry ret = new Geometry(NDalicPINVOKE.Renderer_GetGeometry(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -128,9 +126,7 @@ namespace Tizen.NUI
 
         public TextureSet GetTextures()
         {
-            System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr);
-            TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TextureSet;
-
+            TextureSet ret = new TextureSet(NDalicPINVOKE.Renderer_GetTextures(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -143,9 +139,7 @@ namespace Tizen.NUI
 
         public Shader GetShader()
         {
-            System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr);
-            Shader ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Shader;
-
+            Shader ret = new Shader(NDalicPINVOKE.Renderer_GetShader(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index cbb0394..c7ee739 100755 (executable)
@@ -78,9 +78,7 @@ namespace Tizen.NUI
 
         public Texture GetTexture(uint index)
         {
-            System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index);
-            Texture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
-
+            Texture ret = new Texture(NDalicPINVOKE.TextureSet_GetTexture(swigCPtr, index), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -93,9 +91,7 @@ namespace Tizen.NUI
 
         public Sampler GetSampler(uint index)
         {
-            System.IntPtr cPtr = NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index);
-            Sampler ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler;
-
+            Sampler ret = new Sampler(NDalicPINVOKE.TextureSet_GetSampler(swigCPtr, index), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 41c9b7a..8229740 100755 (executable)
@@ -145,7 +145,7 @@ namespace Tizen.NUI
         [Obsolete("Please do not use! this will be deprecated")]
         public static Timer DownCast(BaseHandle handle)
         {
-            Timer ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Timer;
+            Timer ret = new Timer(NDalicPINVOKE.Timer_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a181fb5..a547720 100755 (executable)
@@ -70,12 +70,7 @@ namespace Tizen.NUI
 
         internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr)
         {
-            Touch ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Touch;
-            if (ret == null)
-            {
-                ret = new Touch(cPtr, false);
-            }
-
+            Touch ret = new Touch(cPtr, false);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -152,9 +147,7 @@ namespace Tizen.NUI
         /// <returns>The actor that was underneath the point specified</returns>
         public View GetHitView(uint point)
         {
-            global::System.IntPtr cPtr = NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point);
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 24a606d..1a933a4 100755 (executable)
@@ -352,7 +352,7 @@ namespace Tizen.NUI.UIComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static Popup DownCast(BaseHandle handle)
         {
-            Popup ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Popup;
+            Popup ret = new Popup(NDalicPINVOKE.Popup_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -369,9 +369,7 @@ namespace Tizen.NUI.UIComponents
 
         internal View GetTitle()
         {
-            IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr);
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.Popup_GetTitle(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -388,9 +386,7 @@ namespace Tizen.NUI.UIComponents
 
         internal View GetContent()
         {
-            IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr);
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.Popup_GetContent(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -407,9 +403,7 @@ namespace Tizen.NUI.UIComponents
 
         internal View GetFooter()
         {
-            IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr);
-            View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View;
-
+            View ret = new View(NDalicPINVOKE.Popup_GetFooter(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 4c8ee8e..39bd34c 100755 (executable)
@@ -93,7 +93,7 @@ namespace Tizen.NUI.UIComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static PushButton DownCast(BaseHandle handle)
         {
-            PushButton ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as PushButton;
+            PushButton ret = new PushButton(NDalicPINVOKE.PushButton_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 51417f2..d1d619f 100755 (executable)
@@ -225,7 +225,7 @@ namespace Tizen.NUI.UIComponents
         [Obsolete("Please do not use! this will be deprecated")]
         public new static ScrollBar DownCast(BaseHandle handle)
         {
-            ScrollBar ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollBar;
+            ScrollBar ret = new ScrollBar(NDalicPINVOKE.ScrollBar_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index a7d6882..6783fe0 100755 (executable)
@@ -474,7 +474,7 @@ namespace Tizen.NUI.UIComponents
         /// <returns>Handle to a Slider or an uninitialized handle</returns>
         public new static Slider DownCast(BaseHandle handle)
         {
-            Slider ret =  Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider;
+            Slider ret = new Slider(NDalicPINVOKE.Slider_DownCast(BaseHandle.getCPtr(handle)), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 5d40948..9c6e7c2 100755 (executable)
@@ -70,7 +70,7 @@ namespace Tizen.NUI
         /// Create or retrieve VisualFactory singleton.
         /// </summary>
         /// <returns>A handle to the VisualFactory control.</returns>
-        private static VisualFactory Get()
+        public static VisualFactory Get()
         {
             VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
index 6a1e21a..793e1a5 100755 (executable)
@@ -558,9 +558,7 @@ namespace Tizen.NUI
 
         public Layer GetLayer(uint depth)
         {
-            IntPtr cPtr = NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth);
-            Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer;
-
+            Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -663,7 +661,7 @@ namespace Tizen.NUI
 
         internal ResizedSignal ResizedSignal()
         {
-            ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false);
+            ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(stageCPtr), false);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -1181,7 +1179,7 @@ namespace Tizen.NUI
 
         private WindowResizedEventCallbackType _windowResizedEventCallback;
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
+        private delegate void WindowResizedEventCallbackType(Size2D windowSize);
         private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
 
         public event EventHandler<ResizedEventArgs> Resized
@@ -1207,12 +1205,10 @@ namespace Tizen.NUI
             }
         }
 
-        private void OnResized(IntPtr windowSize)
+        private void OnResized(Size2D windowSize)
         {
             ResizedEventArgs e = new ResizedEventArgs();
-            var val = new Uint16Pair(windowSize, false);
-            e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
-            val.Dispose();
+            e.WindowSize = windowSize;
 
             if (_windowResizedEventHandler != null)
             {
@@ -1228,10 +1224,7 @@ namespace Tizen.NUI
 
         internal Size2D GetWindowSize()
         {
-            var val = new Uint16Pair(NDalicManualPINVOKE.GetSize(swigCPtr), false);
-            Size2D ret = new Size2D(val.GetWidth(), val.GetHeight());
-            val.Dispose();
-
+            Size2D ret = new Size2D(NDalicManualPINVOKE.GetSize(swigCPtr), true);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }