using System.Globalization;
using Tizen.NUI;
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
- internal class Vector2TypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class Vector2TypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Vector2)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- return ToString((Vector2)value);
+ return ToString(value as Vector2);
}
internal static Vector2 FromString(string value)
internal static string ToString(Vector2 value)
{
- return value.X.ToString() + " " + value.Y.ToString();
+ if (null != value)
+ {
+ return value.X.ToString() + " " + value.Y.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
- internal class Vector3TypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class Vector3TypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Vector3)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- Vector3 vector = (Vector3)value;
- return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString();
+ Vector3 vector = value as Vector3;
+ if (null != vector)
+ {
+ return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
- internal class Vector4TypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class Vector4TypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Vector4)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- Vector4 vector = (Vector4)value;
- return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString() + " " + vector.W.ToString();
+ Vector4 vector = value as Vector4;
+ if (null != vector)
+ {
+ return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString() + " " + vector.W.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
- internal class RelativeVector2TypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class RelativeVector2TypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(RelativeVector2)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- RelativeVector2 vector = (RelativeVector2)value;
- return vector.X.ToString() + " " + vector.Y.ToString();
+ RelativeVector2 vector = value as RelativeVector2;
+ if (null != vector)
+ {
+ return vector.X.ToString() + " " + vector.Y.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
- internal class RelativeVector3TypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class RelativeVector3TypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(RelativeVector3)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- RelativeVector3 vector = (RelativeVector3)value;
- return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString();
+ RelativeVector3 vector = value as RelativeVector3;
+ if (null != vector)
+ {
+ return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
- internal class RelativeVector4TypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class RelativeVector4TypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(RelativeVector4)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- RelativeVector4 vector = (RelativeVector4)value;
- return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString() + " " + vector.W.ToString(); ;
+ RelativeVector4 vector = value as RelativeVector4;
+ if (null != vector)
+ {
+ return vector.X.ToString() + " " + vector.Y.ToString() + " " + vector.Z.ToString() + " " + vector.W.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
}