From: Bowon Ryu Date: Tue, 7 Jun 2022 04:22:32 +0000 (+0900) Subject: [NUI] Remove GetDescription() in TextLabelBindableProperty X-Git-Tag: accepted/tizen/unified/20231205.024657~914 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9978928b2ec00d67075d2a3839829faefd8d509d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Remove GetDescription() in TextLabelBindableProperty remove GetDescription() for better performance. and there is no need to convert string to enum. because the HORIZONTAL_ALIGNMENT and VERTICAL_ALIGNMENT properties of DALi can be set to an integer or string, and there is no burden if it is an integer(enum). Signed-off-by: Bowon Ryu --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs index f0970ff..d20632c 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabelBindableProperty.cs @@ -161,11 +161,9 @@ namespace Tizen.NUI.BaseComponents public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; - string valueToString = ""; if (newValue != null) { - valueToString = ((HorizontalAlignment)newValue).GetDescription(); - Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.HorizontalAlignment, new Tizen.NUI.PropertyValue(valueToString)); + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.HorizontalAlignment, new Tizen.NUI.PropertyValue((int)newValue)); } }), defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) => @@ -183,11 +181,9 @@ namespace Tizen.NUI.BaseComponents public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; - string valueToString = ""; if (newValue != null) { - valueToString = ((VerticalAlignment)newValue).GetDescription(); - Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.VerticalAlignment, new Tizen.NUI.PropertyValue(valueToString)); + Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)textLabel.SwigCPtr, TextLabel.Property.VerticalAlignment, new Tizen.NUI.PropertyValue((int)newValue)); } }), defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>