3 using System.Reflection;
7 namespace Tizen.NUI.Binding
9 internal class SizeTypeConverter : TypeConverter
11 public override object ConvertFromInvariantString(string value)
15 string[] parts = value.Split(',');
16 if (parts.Length == 3)
18 return new Size(float.Parse(parts[0].Trim()), float.Parse(parts[1].Trim()), float.Parse(parts[2].Trim()));
22 throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Size)}");
26 internal class Size2DTypeConverter : TypeConverter
28 public override object ConvertFromInvariantString(string value)
32 string[] parts = value.Split(',');
33 if (parts.Length == 2)
35 return new Size2D(int.Parse(parts[0].Trim()), int.Parse(parts[1].Trim()));
39 throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Size2D)}");