[NUI] Fix to follow c# coding rule
authorhuiyu.eun <huiyu.eun@samsung.com>
Tue, 31 Aug 2021 09:41:02 +0000 (18:41 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 1 Sep 2021 08:20:01 +0000 (17:20 +0900)
Follow C# Coding rule
 - reposition the type of class
 - delete unusued using state
 - follow event naming rule

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/Common/ProcessorController.cs
src/Tizen.NUI/src/internal/Interop/Interop.ProcessorController.cs
src/Tizen.NUI/src/internal/Layouting/LayoutController.cs

index 85e34af..6b0ed3c 100755 (executable)
  *
  */
 
-using Tizen.NUI.BaseComponents;
 using System.Runtime.InteropServices;
-using System.Collections.Generic;
-using System.Diagnostics;
 using System;
 using System.ComponentModel;
 
@@ -36,16 +33,7 @@ namespace Tizen.NUI
     /// </summary>
     internal sealed class ProcessorController : Disposable
     {
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        internal delegate void ProcessorCallback();
-
-        private ProcessorCallback callback = null;
-
-        public event EventHandler ProcessorOnceEvent;
-
-        public event EventHandler ProcessorEvent;
-
-        public event EventHandler LayoutProcessorEvent;
+        private static ProcessorController instance = null;
 
         private ProcessorController() : this(Interop.ProcessorController.New(), true)
         {
@@ -53,17 +41,24 @@ namespace Tizen.NUI
 
         internal ProcessorController(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
         {
-            callback = new ProcessorCallback(Process);
-            Interop.ProcessorController.SetCallback(SwigCPtr, callback);
+            processorCallback = new ProcessorEventHandler(Process);
+            Interop.ProcessorController.SetCallback(SwigCPtr, processorCallback);
         }
 
-        private static ProcessorController instance = null;
+        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+        internal delegate void ProcessorEventHandler();
+
+        private ProcessorEventHandler processorCallback = null;
+
+        public event EventHandler ProcessorOnceEvent;
+        public event EventHandler ProcessorEvent;
+        public event EventHandler LayoutProcessorEvent;
 
         public static ProcessorController Instance
         {
             get
             {
-                if(instance == null)
+                if (instance == null)
                 {
                     instance = new ProcessorController();
                 }
@@ -85,7 +80,7 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void Dispose(DisposeTypes type)
         {
-            Interop.ProcessorController.RemoveCallback(SwigCPtr, callback);
+            Interop.ProcessorController.RemoveCallback(SwigCPtr, processorCallback);
             ProcessorOnceEvent = null;
             ProcessorEvent = null;
             LayoutProcessorEvent = null;
index d63e6f2..84b2bbd 100755 (executable)
@@ -29,10 +29,10 @@ namespace Tizen.NUI
             public static extern global::System.IntPtr DeleteProcessorController(global::System.Runtime.InteropServices.HandleRef processorController);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProcessorController_SetCallback")]
-            public static extern void SetCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorCallback processorCallback);
+            public static extern void SetCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorEventHandler processorCallback);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ProcessorController_RemoveCallback")]
-            public static extern void RemoveCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorCallback processorCallback);
+            public static extern void RemoveCallback(global::System.Runtime.InteropServices.HandleRef processorController, Tizen.NUI.ProcessorController.ProcessorEventHandler processorCallback);
         }
     }
 }
index e103a19..9a7a15e 100755 (executable)
@@ -16,9 +16,7 @@
  */
 
 using Tizen.NUI.BaseComponents;
-using System.Runtime.InteropServices;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System;
 using System.ComponentModel;
 
@@ -33,17 +31,13 @@ namespace Tizen.NUI
         private static int layoutControllerID = 1;
 
         private int id;
-
-        private ProcessorController.ProcessorCallback LayoutProcessorCallback = null;
-
         private Window window;
-
-        Animation coreAnimation;
-
+        private Animation coreAnimation;
         private List<LayoutData> layoutTransitionDataQueue;
-
         private List<LayoutItem> itemRemovalQueue;
 
+        private ProcessorController.ProcessorEventHandler LayoutProcessorCallback = null;
+
         /// <summary>
         /// Constructs a LayoutController which controls the measuring and layouting.<br />
         /// <param name="window">Window attach this LayoutController to.</param>
@@ -56,6 +50,14 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// Set or Get Layouting core animation override property.
+        /// Gives explicit control over the Layouting animation playback if set to True.
+        /// Reset to False if explicit control no longer required.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public bool OverrideCoreAnimation { get; set; } = false;
+
+        /// <summary>
         /// Get the unique id of the LayoutController
         /// </summary>
         public int GetId()
@@ -81,6 +83,29 @@ namespace Tizen.NUI
             }
         }
 
+
+        /// <summary>
+        /// Entry point into the C# Layouting that starts the Processing
+        /// </summary>
+        public void Process(object source, EventArgs e)
+        {
+            Vector2 windowSize = window.GetSize();
+            float width = windowSize.Width;
+            float height = windowSize.Height;
+
+            window.LayersChildren?.ForEach(layer =>
+            {
+                layer?.Children?.ForEach(view =>
+                {
+                    if (view != null)
+                    {
+                        FindRootLayouts(view, width, height);
+                    }
+                });
+            });
+            windowSize.Dispose();
+            windowSize = null;
+        }
         /// <summary>
         /// Get the Layouting animation object that transitions layouts and content.
         /// Use OverrideCoreAnimation to explicitly control Playback.
@@ -93,14 +118,6 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Set or Get Layouting core animation override property.
-        /// Gives explicit control over the Layouting animation playback if set to True.
-        /// Reset to False if explicit control no longer required.
-        /// </summary>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public bool OverrideCoreAnimation { get; set; } = false;
-
-        /// <summary>
         /// Create and set process callback
         /// </summary>
         internal void CreateProcessCallback()
@@ -143,7 +160,7 @@ namespace Tizen.NUI
                 return;
             }
 
-            if(LayoutProcessorCallback != null)
+            if (LayoutProcessorCallback != null)
             {
                 ProcessorController.Instance.LayoutProcessorEvent -= Process;
                 LayoutProcessorCallback = null;
@@ -188,7 +205,7 @@ namespace Tizen.NUI
         // Can be called from multiple starting roots but in series.
         // Get parent View's Size.  If using Legacy size negotiation then should have been set already.
         // Parent not a View so assume it's a Layer which is the size of the window.
-        void MeasureAndLayout(View root, float parentWidth, float parentHeight)
+        private void MeasureAndLayout(View root, float parentWidth, float parentHeight)
         {
             if (root.Layout != null)
             {
@@ -247,29 +264,6 @@ namespace Tizen.NUI
         }
 
         /// <summary>
-        /// Entry point into the C# Layouting that starts the Processing
-        /// </summary>
-        public void Process(object source, EventArgs e)
-        {
-            Vector2 windowSize = window.GetSize();
-            float width = windowSize.Width;
-            float height = windowSize.Height;
-
-            window.LayersChildren?.ForEach(layer =>
-            {
-                layer?.Children?.ForEach(view =>
-                {
-                    if (view != null)
-                    {
-                        FindRootLayouts(view, width, height);
-                    }
-                });
-            });
-            windowSize.Dispose();
-            windowSize = null;
-        }
-
-        /// <summary>
         /// Starts measuring the tree, starting from the root layout.
         /// </summary>
         private void MeasureHierarchy(View root, MeasureSpecification widthSpec, MeasureSpecification heightSpec)