*/
using System;
+using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
using Tizen.NUI.Binding;
namespace Tizen.NUI
/// <summary>
/// KeyValue class.
/// </summary>
- public class KeyValue
+ public class KeyValue : IDisposable
{
+ private bool disposed = false;
/// <summary>
/// Int key.
/// </summary>
+ /// When deleting the field, change it to prperty.
+ [Obsolete("Deprecated in API9, Will be removed in API11. Please use IntegerKey instead.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
public int? KeyInt = null;
/// <summary>
/// String key.
/// </summary>
+ /// When deleting the field, change it to prperty.
+ [Obsolete("Deprecated in API9, Will be removed in API11. Please use StringKey instead.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
public string KeyString = null;
/// <summary>
/// True value.
/// </summary>
+ /// When deleting the field, change it to prperty.
+ [Obsolete("Deprecated in API9, Will be removed in API11. Please use PropertyValue instead.")]
+ [SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
public PropertyValue TrueValue = null;
private string _key = null;
}
/// <summary>
+ /// Int key.
+ /// </summary>
+ /// When deleting the field, change it to prperty.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public int? IntegerKey
+ {
+ get
+ {
+ return KeyInt;
+ }
+ set
+ {
+ KeyInt = value;
+ }
+ }
+
+ /// <summary>
+ /// String key.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public string StringKey
+ {
+ get
+ {
+ return KeyString;
+ }
+ set
+ {
+ KeyString = value;
+ }
+ }
+
+ /// <summary>
+ /// Property value.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public PropertyValue PropertyValue
+ {
+ get
+ {
+ return TrueValue;
+ }
+ set
+ {
+ TrueValue = value;
+ }
+ }
+
+ /// <summary>
/// IntergerValue property.
/// </summary>
public int IntergerValue
{
+ get
+ {
+ if (TrueValue.Get(out int retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get IntergerValue from PropertyValue! Return ErrorValue(-1)!");
+ return -1;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public bool BooleanValue
{
+ get
+ {
+ if (TrueValue.Get(out bool retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get BooleanValue from PropertyValue! Return false!");
+ return false;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public float SingleValue
{
+ get
+ {
+ if (TrueValue.Get(out float retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get SingleValue from PropertyValue! Return ErrorValue(-1)!");
+ return -1;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public string StringValue
{
+ get
+ {
+ if (TrueValue.Get(out string retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get SingleValue from PropertyValue! Return ErrorString(error to get StringValue)!");
+ return "error to get StringValue";
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Vector2 Vector2Value
{
+ get
+ {
+ Vector2 retrivedValue = new Vector2(0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get Vector2Value from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Vector3 Vector3Value
{
+ get
+ {
+ Vector3 retrivedValue = new Vector3(0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get Vector3Value from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Vector4 Vector4Value
{
+ get
+ {
+ Vector4 retrivedValue = new Vector4(0, 0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get Vector4Value from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Position PositionValue
{
+ get
+ {
+ Position retrivedValue = new Position(0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get PositionValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Position2D Position2DValue
{
+ get
+ {
+ Position2D retrivedValue = new Position2D(0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get Position2DValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Size SizeValue
{
+ get
+ {
+ Size retrivedValue = new Size(0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get SizeValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Size2D Size2DValue
{
+ get
+ {
+ Size2D retrivedValue = new Size2D(0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get Size2DValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Color ColorValue
{
+ get
+ {
+ Color retrivedValue = new Color(0, 0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get ColorValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Rectangle RectangleValue
{
+ get
+ {
+ Rectangle retrivedValue = new Rectangle(0, 0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get RectangleValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Rotation RotationValue
{
+ get
+ {
+ Rotation retrivedValue = new Rotation();
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get RotationValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public RelativeVector2 RelativeVector2Value
{
+ get
+ {
+ RelativeVector2 retrivedValue = new RelativeVector2(0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get RelativeVector2Value from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public RelativeVector3 RelativeVector3Value
{
+ get
+ {
+ RelativeVector3 retrivedValue = new RelativeVector3(0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get RelativeVector3Value from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public RelativeVector4 RelativeVector4Value
{
+ get
+ {
+ RelativeVector4 retrivedValue = new RelativeVector4(0, 0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get RelativeVector4Value from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public Extents ExtentsValue
{
+ get
+ {
+ Extents retrivedValue = new Extents(0, 0, 0, 0);
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get ExtentsValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public PropertyArray PropertyArrayValue
{
+ get
+ {
+ PropertyArray retrivedValue = new PropertyArray();
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get PropertyArrayValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
/// </summary>
public PropertyMap PropertyMapValue
{
+ get
+ {
+ PropertyMap retrivedValue = new PropertyMap();
+ if (TrueValue.Get(retrivedValue))
+ {
+ return retrivedValue;
+ }
+ NUILog.Error($"[ERROR] Fail to get PropertyMapValue from PropertyValue!");
+ return retrivedValue;
+ }
set
{
TrueValue = new PropertyValue(value);
KeyString = Key;
}
}
+
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (disposing)
+ {
+ TrueValue?.Dispose();
+ }
+ disposed = true;
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void Dispose()
+ {
+ Dispose(true);
+ global::System.GC.SuppressFinalize(this);
+ }
}
}