[NUI][API10] Fix a svace issue in CustomViewRegistry.cs.
authorhuayong.xu <huayong.xu@samsung.com>
Mon, 12 Jun 2023 11:05:56 +0000 (19:05 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 12 Jun 2023 11:28:32 +0000 (20:28 +0900)
src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs

index 8d50297..aec370b 100755 (executable)
@@ -257,11 +257,17 @@ namespace Tizen.NUI
                 throw new ArgumentNullException(nameof(viewType));
             }
 
+            var viewTypeString = viewType.ToString();
+            if (null == viewTypeString)
+            {
+                throw new ArgumentNullException(viewTypeString);
+            }
+
             // add the mapping between the view name and it's create function
-            constructorMap.Add(viewType.ToString(), createFunction);
+            constructorMap.Add(viewTypeString, createFunction);
 
             // Call into DALi C++ to register the control with the type registry
-            TypeRegistration.RegisterControl(viewType.ToString(), createCallback);
+            TypeRegistration.RegisterControl(viewTypeString, createCallback);
 
             // Cycle through each property in the class
             foreach (System.Reflection.PropertyInfo propertyInfo in viewType.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public))
@@ -283,14 +289,14 @@ namespace Tizen.NUI
                             ScriptableProperty scriptableProp = attr as ScriptableProperty;
 
                             // we get the start property index, based on the type and it's hierarchy, e.g. DateView (70,000)-> Spin (60,000) -> View (50,000)
-                            int propertyIndex = propertyRangeManager.GetPropertyIndex(viewType.ToString(), viewType, scriptableProp.type);
+                            int propertyIndex = propertyRangeManager.GetPropertyIndex(viewTypeString, viewType, scriptableProp.type);
 
                             // get the enum for the property type... E.g. registering a string property returns Tizen.NUI.PropertyType.String
                             Tizen.NUI.PropertyType propertyType = GetDaliPropertyType(propertyInfo.PropertyType.Name);
 
                             // Example   RegisterProperty("spin","maxValue", 50001, FLOAT, set, get );
                             // Native call to register the property
-                            TypeRegistration.RegisterProperty(viewType.ToString(), propertyInfo.Name, propertyIndex, propertyType, setPropertyCallback, getPropertyCallback);
+                            TypeRegistration.RegisterProperty(viewTypeString, propertyInfo.Name, propertyIndex, propertyType, setPropertyCallback, getPropertyCallback);
                         }
                     }
                     NUILog.Debug("property name = " + propertyInfo.Name);