3 using System.Reflection;
4 using System.Globalization;
8 using System.ComponentModel;
10 namespace Tizen.NUI.Binding
12 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
13 [EditorBrowsable(EditorBrowsableState.Never)]
14 [ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.Size2DTypeConverter")]
15 public class SizeTypeConverter : TypeConverter
17 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
18 [EditorBrowsable(EditorBrowsableState.Never)]
19 public override object ConvertFromInvariantString(string value)
23 string[] parts = value.Split(',');
24 if (parts.Length == 3)
26 int x = (int)GraphicsTypeManager.Instance.ConvertScriptToPixel(parts[0].Trim());
27 int y = (int)GraphicsTypeManager.Instance.ConvertScriptToPixel(parts[1].Trim());
28 int z = (int)GraphicsTypeManager.Instance.ConvertScriptToPixel(parts[2].Trim());
29 return new Size(x, y, z);
33 throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Size)}");
37 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
38 [EditorBrowsable(EditorBrowsableState.Never)]
39 [ProvideCompiledAttribute("Tizen.NUI.Xaml.Core.XamlC.Size2DTypeConverter")]
40 public class Size2DTypeConverter : TypeConverter
42 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
43 [EditorBrowsable(EditorBrowsableState.Never)]
44 public override object ConvertFromInvariantString(string value)
48 string[] parts = value.Split(',');
49 if (parts.Length == 2)
51 int x = (int)GraphicsTypeManager.Instance.ConvertScriptToPixel(parts[0].Trim());
52 int y = (int)GraphicsTypeManager.Instance.ConvertScriptToPixel(parts[1].Trim());
53 return new Size2D(x, y);
57 throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Size2D)}");