}
set
{
- textSelector.Clone(value);
+ if (value == null || textSelector == null)
+ {
+ Tizen.Log.Fatal("NUI", "[Exception] Button.TextSelector is null");
+ throw new NullReferenceException("Button.TextSelector is null");
+ }
+ else
+ {
+ textSelector.Clone(value);
+ }
}
}
}
set
{
- translatableTextSelector.Clone(value);
+ if (value == null || translatableTextSelector == null)
+ {
+ Tizen.Log.Fatal("NUI", "[Exception] Button.TranslatableTextSelector is null");
+ throw new NullReferenceException("Button.TranslatableTextSelector is null");
+ }
+ else
+ {
+ translatableTextSelector.Clone(value);
+ }
}
}
}
set
{
- textColorSelector.Clone(value);
+ if (value == null || textColorSelector == null)
+ {
+ Tizen.Log.Fatal("NUI", "[Exception] Button.textColorSelector is null");
+ throw new NullReferenceException("Button.textColorSelector is null");
+ }
+ else
+ {
+ textColorSelector.Clone(value);
+ }
}
}
}
set
{
- pointSizeSelector.Clone(value);
+ if (value == null || pointSizeSelector == null)
+ {
+ Tizen.Log.Fatal("NUI", "[Exception] Button.pointSizeSelector is null");
+ throw new NullReferenceException("Button.pointSizeSelector is null");
+ }
+ else
+ {
+ pointSizeSelector.Clone(value);
+ }
}
}
}
set
{
- iconURLSelector.Clone(value);
+ if (value == null || iconURLSelector == null)
+ {
+ Tizen.Log.Fatal("NUI", "[Exception] Button.iconURLSelector is null");
+ throw new NullReferenceException("Button.iconURLSelector is null");
+ }
+ else
+ {
+ iconURLSelector.Clone(value);
+ }
}
}
}
set
{
- if(Style != null && Style.IconRelativeOrientation != value)
+ if (Style != null && Style.IconRelativeOrientation != value)
{
Style.IconRelativeOrientation = value;
UpdateUIContent();
/// <since_tizen> 6 </since_tizen>
public Extents TextPadding
{
- get => (Extents) GetValue(TextPaddingProperty);
+ get => (Extents)GetValue(TextPaddingProperty);
set => SetValue(TextPaddingProperty, value);
}
if (null == touch) return false;
PointStateType state = touch.GetState(0);
- switch(state)
+ switch (state)
{
case PointStateType.Down:
isPressed = true;
UpdateState();
return true;
case PointStateType.Up:
- {
- bool clicked = isPressed && isEnabled;
-
- isPressed = false;
-
- if (Style.IsSelectable != null && Style.IsSelectable == true)
- {
- SelectionChangedByTouch = touch;
- IsSelected = !IsSelected;
- }
- else
{
- UpdateState(touch);
+ bool clicked = isPressed && isEnabled;
+
+ isPressed = false;
+
+ if (Style.IsSelectable != null && Style.IsSelectable == true)
+ {
+ SelectionChangedByTouch = touch;
+ IsSelected = !IsSelected;
+ }
+ else
+ {
+ UpdateState(touch);
+ }
+
+ if (clicked)
+ {
+ ClickEventArgs eventArgs = new ClickEventArgs();
+ OnClickInternal(eventArgs);
+ }
+
+ return true;
}
-
- if (clicked)
- {
- ClickEventArgs eventArgs = new ClickEventArgs();
- OnClickInternal(eventArgs);
- }
-
- return true;
- }
default:
break;
}