Split ViewRegistry into CustomViewRegistry and Registry 83/134283/9
authorUmar <m.umar@partner.samsung.com>
Thu, 15 Jun 2017 18:04:44 +0000 (19:04 +0100)
committerUmar <m.umar@partner.samsung.com>
Thu, 22 Jun 2017 17:24:04 +0000 (18:24 +0100)
    CustomViewRegistry - For custom views to register themselves as a type
    Registry - For all base-handle objects including renderers and custom views. This is used to store a mapping between C++ base handle objects and it's C# instances.

Change-Id: I2b2e93c653542ebdcd810c8f5977d435fcf5cec2

25 files changed:
NUISamples/NUISamples/NUISamples.TizenTV/examples/custom-control.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/ContactView.cs
NUISamples/NUISamples/NUISamples.TizenTV/examples/visuals-using-custom-view/visuals-using-custom-view.cs
Tizen.NUI/src/internal/Alignment.cs
Tizen.NUI/src/internal/GaussianBlurView.cs
Tizen.NUI/src/internal/ItemView.cs
Tizen.NUI/src/internal/Model3dView.cs
Tizen.NUI/src/internal/PageTurnLandscapeView.cs
Tizen.NUI/src/internal/PageTurnPortraitView.cs
Tizen.NUI/src/internal/PageTurnView.cs
Tizen.NUI/src/internal/Registry.cs [new file with mode: 0755]
Tizen.NUI/src/internal/Slider.cs
Tizen.NUI/src/public/BaseComponents/View.cs
Tizen.NUI/src/public/BaseComponents/VisualView.cs
Tizen.NUI/src/public/CustomView/Spin.cs
Tizen.NUI/src/public/CustomViewRegistry.cs [moved from Tizen.NUI/src/internal/ViewRegistry.cs with 82% similarity, mode: 0644]
Tizen.NUI/src/public/Layer.cs
Tizen.NUI/src/public/ProgressBar.cs
Tizen.NUI/src/public/Scrollable.cs
Tizen.NUI/src/public/UIComponents/Button.cs
Tizen.NUI/src/public/UIComponents/Popup.cs
Tizen.NUI/src/public/UIComponents/RadioButton.cs
Tizen.NUI/src/public/UIComponents/ScrollView.cs
Tizen.NUI/src/public/UIComponents/ToggleButton.cs
Tizen.NUI/src/public/ViewWrapper.cs

index 57afb4f..0a37c07 100644 (file)
@@ -46,7 +46,7 @@ namespace CustomControlTest
         {
           // ViewRegistry registers control type with DALi type registery
           // also uses introspection to find any properties that need to be registered with type registry
-          ViewRegistry.Instance.Register(CreateInstance, typeof(StarRating) );
+          CustomViewRegistry.Instance.Register(CreateInstance, typeof(StarRating) );
         }
 
         public StarRating() : base(typeof(StarRating).Name, CustomViewBehaviour.ViewBehaviourDefault)
index d33faae..1e25c73 100644 (file)
@@ -50,7 +50,7 @@ namespace VisualsUsingCustomView
 
         static ContactView()
         {
-            ViewRegistry.Instance.Register( CreateInstance, typeof(ContactView));
+            CustomViewRegistry.Instance.Register( CreateInstance, typeof(ContactView));
         }
 
         public ContactView() : base(typeof(ContactView).Name, CustomViewBehaviour.RequiresKeyboardNavigationSupport)
index 2143e5c..91f28fb 100644 (file)
@@ -91,7 +91,7 @@ namespace VisualsUsingCustomView
         /// The main entry point for the application.
         /// </summary>
         [STAThread]
-        static void Main(string[] args)
+        static void _Main(string[] args)
         {
             VisualsExample visualsExample = new VisualsExample();
             visualsExample.Run(args);
index 60bd41e..d1e588b 100755 (executable)
@@ -64,8 +64,8 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 3eb587a..180eb91 100755 (executable)
@@ -68,8 +68,8 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index b89d326..15d9bc6 100755 (executable)
@@ -67,7 +67,7 @@ namespace Tizen.NUI
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index f43f6df..7f1b0fb 100755 (executable)
@@ -64,8 +64,8 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index f72cb36..5ca22ec 100755 (executable)
@@ -60,8 +60,8 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index c839ad1..11b6d07 100755 (executable)
@@ -60,8 +60,8 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index a7867e0..6f2b240 100755 (executable)
@@ -50,8 +50,8 @@ namespace Tizen.NUI
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
diff --git a/Tizen.NUI/src/internal/Registry.cs b/Tizen.NUI/src/internal/Registry.cs
new file mode 100755 (executable)
index 0000000..ffb9c78
--- /dev/null
@@ -0,0 +1,122 @@
+
+//#define DOT_NET_CORE
+#if (DOT_NET_CORE)
+using System.Reflection;
+#endif
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI
+{
+    /// <summary>
+    /// This is used to store a mapping between C++ base handle objects and it's C# instances.
+    ///
+    /// </summary>
+    internal sealed class Registry
+    {
+        /// <summary>
+        /// Registry is a singleton
+        /// </summary>
+        private static Registry instance = null;
+
+        /// <summary>
+        /// Given a C++ object the dictionary allows us to find which C# object it belongs to.
+        /// By keeping the weak reference only, it will allow the object to be garbage collected.
+        /// </summary>
+        private Dictionary<IntPtr, WeakReference> _controlMap;
+
+        private Registry()
+        {
+            _controlMap = new Dictionary<IntPtr, WeakReference>();
+        }
+
+
+        /// <summary>
+        /// Store the mapping between this instance of BaseHandle (C# base class) and native part.
+        /// </summary>
+        /// <param name="baseHandle"> The instance of BaseHandle (C# base class)</param>
+        internal static void Register(BaseHandle baseHandle)
+        {
+            // We store a pointer to the RefObject for the control
+            RefObject refObj = baseHandle.GetObjectPtr();
+            IntPtr refCptr = (IntPtr)RefObject.getCPtr(refObj);
+
+#if DEBUG_ON
+            Tizen.Log.Debug("NUI", "________Storing ref object cptr in control map Hex: {0:X}" + refCptr);
+#endif
+            if (!Instance._controlMap.ContainsKey(refCptr))
+            {
+                Instance._controlMap.Add(refCptr, new WeakReference(baseHandle, false));
+            }
+
+            return;
+        }
+
+        /// <summary>
+        /// Remove the this instance of BaseHandle (C# base class) and native part from the mapping table.
+        /// </summary>
+        /// <param name="view"> The instance of BaseHandle (C# base class)</param>
+        internal static void Unregister(BaseHandle baseHandle)
+        {
+            RefObject refObj = baseHandle.GetObjectPtr();
+            IntPtr refCptr = (IntPtr)RefObject.getCPtr(refObj);
+
+            if (Instance._controlMap.ContainsKey(refCptr))
+            {
+                Instance._controlMap.Remove(refCptr);
+            }
+
+            return;
+        }
+
+        private static Registry Instance
+        {
+            get
+            {
+                if (instance == null)
+                {
+                    instance = new Registry();
+                }
+                return instance;
+            }
+        }
+
+        internal static BaseHandle GetManagedBaseHandleFromNativePtr(BaseHandle baseHandle)
+        {
+            // we store a dictionary of ref-obects (C++ land) to managed obects (C# land)
+
+            RefObject refObj = baseHandle.GetObjectPtr();
+            IntPtr refObjectPtr = (IntPtr)RefObject.getCPtr(refObj);
+
+            WeakReference viewReference;
+            if (Instance._controlMap.TryGetValue(refObjectPtr, out viewReference))
+            {
+                BaseHandle ret = viewReference.Target as BaseHandle;
+                return ret;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        internal static BaseHandle GetManagedBaseHandleFromRefObject(IntPtr refObjectPtr)
+        {
+            // we store a dictionary of ref-obects (C++ land) to managed obects (C# land)
+
+            WeakReference weakReference;
+            if (Instance._controlMap.TryGetValue(refObjectPtr, out weakReference))
+            {
+                BaseHandle ret = weakReference.Target as BaseHandle;
+                return ret;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+    }
+}
index a6abd07..e7fcdd1 100755 (executable)
@@ -73,7 +73,7 @@ namespace Tizen.NUI.UIComponents
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 6de4705..80b3a38 100755 (executable)
@@ -31,8 +31,8 @@ namespace Tizen.NUI.BaseComponents
         {
             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
 
-            // Register this instance of view in the view registry.
-            ViewRegistry.RegisterView(this);
+            // Register this instance of view in the registry.
+            Registry.Register(this);
         }
 
         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
@@ -60,7 +60,7 @@ namespace Tizen.NUI.BaseComponents
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
@@ -846,7 +846,7 @@ namespace Tizen.NUI.BaseComponents
         /// <returns>A object which inherit View</returns>
         public static T DownCast<T>(View view) where T : View
         {
-            View ret = ViewRegistry.GetViewFromBaseHandle(view);
+            View ret = Registry.GetManagedBaseHandleFromNativePtr(view) as View;
             if (ret != null)
             {
                 return (T)ret;
@@ -2093,7 +2093,7 @@ namespace Tizen.NUI.BaseComponents
 
             BaseHandle ret = new BaseHandle(cPtr, false);
 
-            View temp = ViewRegistry.GetViewFromBaseHandle(ret);
+            View temp = Registry.GetManagedBaseHandleFromNativePtr(ret) as View;
 
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
index 260fcd8..9b6a90f 100755 (executable)
@@ -54,7 +54,7 @@ namespace Tizen.NUI.BaseComponents
         {
             // ViewRegistry registers control type with DALi type registery
             // also uses introspection to find any properties that need to be registered with type registry
-            ViewRegistry.Instance.Register(CreateInstance, typeof(VisualView));
+            CustomViewRegistry.Instance.Register(CreateInstance, typeof(VisualView));
         }
 
         public VisualView() : base(typeof(VisualView).Name, CustomViewBehaviour.ViewBehaviourDefault)
@@ -475,7 +475,7 @@ namespace Tizen.NUI.BaseComponents
         }
 
 
-        //temporary fix to pass TCT 
+        //temporary fix to pass TCT
         public Animation VisualAnimate(Tizen.NUI.VisualAnimator visualMap)
         {
             foreach (var item in _visualDictionary.ToList())
@@ -488,7 +488,7 @@ namespace Tizen.NUI.BaseComponents
             }
             return null;
         }
-        //temporary fix to pass TCT 
+        //temporary fix to pass TCT
 
     }
 }
index f5f71a4..2f0664d 100755 (executable)
@@ -58,7 +58,7 @@ namespace Tizen.NUI
         {
             // ViewRegistry registers control type with DALi type registery
             // also uses introspection to find any properties that need to be registered with type registry
-            ViewRegistry.Instance.Register(CreateInstance, typeof(Spin));
+            CustomViewRegistry.Instance.Register(CreateInstance, typeof(Spin));
         }
 
         /// <summary>
old mode 100755 (executable)
new mode 100644 (file)
similarity index 82%
rename from Tizen.NUI/src/internal/ViewRegistry.cs
rename to Tizen.NUI/src/public/CustomViewRegistry.cs
index 67abc4b..2a5763a
@@ -74,7 +74,7 @@ namespace Tizen.NUI
     /// </remarks>
     ///
     ///
-    internal class ScriptableProperty : System.Attribute
+    public class ScriptableProperty : System.Attribute
     {
         public enum ScriptableType
         {
@@ -123,33 +123,27 @@ namespace Tizen.NUI
     ///
     ///
     /// </summary>
-    public sealed class ViewRegistry
+    public sealed class CustomViewRegistry
     {
         /// <summary>
         /// ViewRegistry is a singleton
         /// </summary>
-        private static ViewRegistry instance = null;
+        private static CustomViewRegistry instance = null;
 
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        delegate IntPtr CreateControlDelegate(IntPtr cPtrControlName);
+        private delegate IntPtr CreateControlDelegate(IntPtr cPtrControlName);
 
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        delegate IntPtr GetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName);
+        private delegate IntPtr GetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName);
 
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        delegate void SetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue);
+        private delegate void SetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue);
 
         private CreateControlDelegate _createCallback;
         private SetPropertyDelegate _setPropertyCallback;
         private GetPropertyDelegate _getPropertyCallback;
         private PropertyRangeManager _propertyRangeManager;
 
-        /// <summary>
-        /// Given a C++ control the dictionary allows us to find which C# control (View) it belongs to.
-        /// By keeping the weak reference only, it will allow the object to be garbage collected.
-        /// </summary>
-        private Dictionary<IntPtr, WeakReference> _controlMap;
-
         ///<summary>
         // Maps the name of a custom view to a create instance function
         /// E.g. given a string "Spin", we can get a function used to create the Spin View.
@@ -178,16 +172,14 @@ namespace Tizen.NUI
         };
 
 
-        private ViewRegistry()
+        private CustomViewRegistry()
         {
             _createCallback = new CreateControlDelegate(CreateControl);
             _getPropertyCallback = new GetPropertyDelegate(GetProperty);
             _setPropertyCallback = new SetPropertyDelegate(SetProperty);
 
-            _controlMap = new Dictionary<IntPtr, WeakReference>();
             _constructorMap = new Dictionary<string, Func<CustomView>>();
             _propertyRangeManager = new PropertyRangeManager();
-
         }
 
         private Tizen.NUI.PropertyType GetDaliPropertyType(string cSharpTypeName)
@@ -236,44 +228,6 @@ namespace Tizen.NUI
             }
         }
 
-        /// <summary>
-        /// Store the mapping between this instance of control (View) and native part.
-        /// </summary>
-        /// <param name="view"> The instance of control (View)</param>
-        internal static void RegisterView(View view)
-        {
-            // We store a pointer to the RefObject for the control
-            RefObject refObj = view.GetObjectPtr();
-            IntPtr refCptr = (IntPtr)RefObject.getCPtr(refObj);
-
-#if DEBUG_ON
-            Tizen.Log.Debug("NUI", "________Storing ref object cptr in control map Hex: {0:X}" + refCptr);
-#endif
-            if (!Instance._controlMap.ContainsKey(refCptr))
-            {
-                Instance._controlMap.Add(refCptr, new WeakReference(view, false));
-            }
-
-            return;
-        }
-
-        /// <summary>
-        /// Remove the this instance of control (View) and native part from the mapping table.
-        /// </summary>
-        /// <param name="view"> The instance of control (View)</param>
-        internal static void UnregisterView(View view)
-        {
-            RefObject refObj = view.GetObjectPtr();
-            IntPtr refCptr = (IntPtr)RefObject.getCPtr(refObj);
-
-            if (Instance._controlMap.ContainsKey(refCptr))
-            {
-                Instance._controlMap.Remove(refCptr);
-            }
-
-            return;
-        }
-
         private static IntPtr GetProperty(IntPtr controlPtr, IntPtr propertyName)
         {
             string name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(propertyName);
@@ -290,39 +244,18 @@ namespace Tizen.NUI
 
         }
 
-        public static ViewRegistry Instance
+        public static CustomViewRegistry Instance
         {
             get
             {
                 if (instance == null)
                 {
-                    instance = new ViewRegistry();
+                    instance = new CustomViewRegistry();
                 }
                 return instance;
             }
         }
 
-
-        internal static View GetViewFromBaseHandle(BaseHandle baseHandle)
-        {
-            // we store a dictionary of ref-obects (C++ land) to custom views (C# land)
-
-            RefObject refObj = baseHandle.GetObjectPtr();
-            IntPtr refObjectPtr = (IntPtr)RefObject.getCPtr(refObj);
-
-            WeakReference viewReference;
-            if (Instance._controlMap.TryGetValue(refObjectPtr, out viewReference))
-            {
-                View retview = viewReference.Target as View;
-                return retview;
-            }
-            else
-            {
-                return null;
-            }
-        }
-
-
         /// <summary>
         /// Function which registers a view and all it's scriptable properties with DALi's type registry.
         /// Means the View can be created / configured from a JSON script.
@@ -394,20 +327,12 @@ namespace Tizen.NUI
         /// Get a property value from a View
         ///
         /// </summary>
-        private IntPtr GetPropertyValue(IntPtr controlPtr, string propertyName)
+        private IntPtr GetPropertyValue(IntPtr refObjectPtr, string propertyName)
         {
             // Get the C# control that maps to the C++ control
-            BaseHandle baseHandle = new BaseHandle(controlPtr, false);
-
-            RefObject refObj = baseHandle.GetObjectPtr();
-
-            IntPtr refObjectPtr = (IntPtr)RefObject.getCPtr(refObj);
-
-            WeakReference viewReference;
-            if (_controlMap.TryGetValue(refObjectPtr, out viewReference))
+            View view = Registry.GetManagedBaseHandleFromRefObject(refObjectPtr) as View;
+            if (view != null)
             {
-                View view = viewReference.Target as View;
-
                 // call the get property function
                 System.Object val = view.GetType().GetProperty(propertyName).GetAccessors()[0].Invoke(view, null);
 
@@ -425,18 +350,18 @@ namespace Tizen.NUI
         /// Set a property value on a View
         ///
         /// </summary>
-        private void SetPropertyValue(IntPtr controlPtr, string propertyName, IntPtr propertyValuePtr)
+        private void SetPropertyValue(IntPtr refObjectPtr, string propertyName, IntPtr propertyValuePtr)
         {
             // Get the C# control that maps to the C++ control
 #if DEBUG_ON
-            Tizen.Log.Debug("NUI", "SetPropertyValue   refObjectPtr = {0:X}" + controlPtr);
+            Tizen.Log.Debug("NUI", "SetPropertyValue   refObjectPtr = {0:X}" + refObjectPtr);
 #endif
             PropertyValue propValue = new PropertyValue(propertyValuePtr, false);
 
-            WeakReference viewReference;
-            if (_controlMap.TryGetValue(controlPtr, out viewReference))
+            // Get the C# control that maps to the C++ control
+            View view = Registry.GetManagedBaseHandleFromRefObject(refObjectPtr) as View;
+            if (view != null)
             {
-                View view = viewReference.Target as View;
                 System.Reflection.PropertyInfo propertyInfo = view.GetType().GetProperty(propertyName);
 
                 // We know the property name, we know it's type, we just need to convert from a DALi property value to native C# type
@@ -546,12 +471,10 @@ namespace Tizen.NUI
             }
             else
             {
-                throw new global::System.InvalidOperationException("failed to find the control to write a property to: cptr = " + controlPtr);
+                throw new global::System.InvalidOperationException("failed to find the control to write a property to: cptr = " + refObjectPtr);
             }
 
         }
 
     }
-
-
 }
index 4c48ab6..d7ffb21 100755 (executable)
@@ -283,7 +283,7 @@ namespace Tizen.NUI
 
             BaseHandle ret = new BaseHandle(cPtr, false);
 
-            View temp = ViewRegistry.GetViewFromBaseHandle(ret);
+            View temp = Registry.GetManagedBaseHandleFromNativePtr(ret) as View;
 
             if (NDalicPINVOKE.SWIGPendingException.Pending)
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
index 6085d40..e2dfec4 100755 (executable)
@@ -73,7 +73,7 @@ namespace Tizen.NUI.UIComponents
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index f6edecc..9602bef 100755 (executable)
@@ -51,7 +51,7 @@ namespace Tizen.NUI
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 2f6422f..7df120d 100755 (executable)
@@ -74,8 +74,8 @@ namespace Tizen.NUI.UIComponents
             //You should not access any managed member here except static instance.
             //because the execution order of Finalizes is non-deterministic.
 
-            //Unreference this from if a static instance refer to this. 
-            ViewRegistry.UnregisterView(this);
+            //Unreference this from if a static instance refer to this.
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index e3c8072..567eb80 100755 (executable)
@@ -71,7 +71,7 @@ namespace Tizen.NUI.UIComponents
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 709dc38..f8816a9 100755 (executable)
@@ -77,7 +77,7 @@ namespace Tizen.NUI.UIComponents
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index b521e63..0846305 100755 (executable)
@@ -65,7 +65,7 @@ namespace Tizen.NUI
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 0f430ba..2ed083f 100755 (executable)
@@ -63,7 +63,7 @@ namespace Tizen.NUI
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {
index 978da1a..087d503 100755 (executable)
@@ -56,7 +56,7 @@ namespace Tizen.NUI
             //because the execution order of Finalizes is non-deterministic.
 
             //Unreference this from if a static instance refer to this.
-            ViewRegistry.UnregisterView(this);
+            Registry.Unregister(this);
 
             if (swigCPtr.Handle != global::System.IntPtr.Zero)
             {