From 9978928b2ec00d67075d2a3839829faefd8d509d Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Tue, 7 Jun 2022 13:22:32 +0900 Subject: [PATCH] [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 --- .../src/public/BaseComponents/TextLabelBindableProperty.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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) => -- 2.7.4