From: huayong.xu Date: Mon, 12 Jun 2023 11:05:56 +0000 (+0800) Subject: [NUI][API10] Fix a svace issue in CustomViewRegistry.cs. X-Git-Tag: submit/tizen_7.0/20230612.151110~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09164b31fb5a66b4e1acda31e480753e74056e8c;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI][API10] Fix a svace issue in CustomViewRegistry.cs. --- diff --git a/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs b/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs index 8d5029700..aec370b25 100755 --- a/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs +++ b/src/Tizen.NUI/src/public/CustomView/CustomViewRegistry.cs @@ -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);