using System.Globalization;
using Tizen.NUI;
+using System.ComponentModel;
namespace Tizen.NUI.Binding
{
- internal class PositionTypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class PositionTypeConverter : 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(Position)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- Position position = (Position)value;
- return position.X.ToString() + " " + position.Y.ToString() + " " + position.Z.ToString();
+ Position position = value as Position;
+ if (null != position)
+ {
+ return position.X.ToString() + " " + position.Y.ToString() + " " + position.Z.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
- internal class Position2DTypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class Position2DTypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
return Position2D.ConvertFromString(value);
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- Position2D position = (Position2D)value;
- return position.X.ToString() + " " + position.Y.ToString();
+ Position2D position = value as Position2D;
+ if (null != position)
+ {
+ return position.X.ToString() + " " + position.Y.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
}
*/
using System;
+using System.ComponentModel;
using System.Globalization;
using Tizen.NUI;
namespace Tizen.NUI.Binding
{
+ //Internal used, will never open
[Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.RectangleTypeConverter")]
[Xaml.TypeConversion(typeof(Rectangle))]
- internal class RectangleTypeConverter : TypeConverter
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class RectangleTypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
if (value != null)
throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", value, typeof(Rectangle)));
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- Rectangle rec = (Rectangle)value;
- return rec.X.ToString() + " " + rec.Y.ToString() + " " + rec.Width.ToString() + " " + rec.Height.ToString();
+ Rectangle rect = value as Rectangle;
+ if (null != rect)
+ {
+ return rect.X.ToString() + " " + rect.Y.ToString() + " " + rect.Width.ToString() + " " + rect.Height.ToString();
+ }
+ else
+ {
+ return null;
+ }
}
}
}
*/
using System;
+using System.ComponentModel;
using System.Globalization;
namespace Tizen.NUI.Binding
{
- internal class RotationTypeConverter : TypeConverter
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class RotationTypeConverter : TypeConverter
{
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
// public Rotation(Radian radian(float), Vector3 vector3)
if (radianOrDegree == "D" || radianOrDegree == "DEGREE")
{
// Orientation="D:23, 0, 0, 1"
- radian = new Radian(new Degree(Single.Parse(head[1].Trim(), CultureInfo.InvariantCulture)));
+ var degree = new Degree(Single.Parse(head[1].Trim(), CultureInfo.InvariantCulture));
+ radian = new Radian(degree);
+ degree.Dispose();
}
else if (radianOrDegree == "R" || radianOrDegree == "RADIAN")
{
Vector3 vector3 = new Vector3(Single.Parse(parts[1].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[2].Trim(), CultureInfo.InvariantCulture),
Single.Parse(parts[3].Trim(), CultureInfo.InvariantCulture));
- return new Rotation(radian, vector3);
+ var ret = new Rotation(radian, vector3);
+ radian?.Dispose();
+ vector3.Dispose();
+ return ret;
}
}
throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Rotation)}");
}
+ //Internal used, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override string ConvertToString(object value)
{
- Rotation rotation = (Rotation)value;
- return rotation.ToString();
+ Rotation rotation = value as Rotation;
+ return rotation?.ToString();
}
}
}
*/
using System;
+using System.ComponentModel;
using System.Globalization;
using Tizen.NUI.Xaml;
namespace Tizen.NUI.Binding
{
+ /// Internal use, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
[Xaml.ProvideCompiled("Tizen.NUI.Xaml.Core.XamlC.TypeTypeConverter")]
[Xaml.TypeConversion(typeof(Type))]
- internal sealed class TypeTypeConverter : TypeConverter, IExtendedTypeConverter
+ public sealed class TypeTypeConverter : TypeConverter, IExtendedTypeConverter
{
[Obsolete("IExtendedTypeConverter.ConvertFrom is obsolete as of version 2.2.0. Please use ConvertFromInvariantString (string, IServiceProvider) instead.")]
object IExtendedTypeConverter.ConvertFrom(CultureInfo culture, object value, IServiceProvider serviceProvider)
return typeResolver.Resolve(value, serviceProvider);
}
+ /// Internal use, will never open
+ [EditorBrowsable(EditorBrowsableState.Never)]
public override object ConvertFromInvariantString(string value)
{
throw new NotImplementedException();
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;
+ }
}
}
}