diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Point.cs b/UIX.RenderApi/Microsoft/Iris/Render/Point.cs index d4c7248..e0cb05f 100644 --- a/UIX.RenderApi/Microsoft/Iris/Render/Point.cs +++ b/UIX.RenderApi/Microsoft/Iris/Render/Point.cs @@ -9,7 +9,7 @@ using System; namespace Microsoft.Iris.Render { [Serializable] - public struct Point + public struct Point : IStringEncodable { private int m_x; private int m_y; @@ -84,5 +84,7 @@ namespace Microsoft.Iris.Render public Size ToSize() => new Size(this.X, this.Y); public static Point Negate(Point point) => new Point(-point.X, -point.Y); + + public string EncodeString() => $"{X}, {Y}"; } } diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs b/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs index 1078900..914fcee 100644 --- a/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs +++ b/UIX.RenderApi/Microsoft/Iris/Render/Vector2.cs @@ -11,7 +11,7 @@ using System.Text; namespace Microsoft.Iris.Render { [Serializable] - public struct Vector2 + public struct Vector2 : IStringEncodable { private float m_x; private float m_y; @@ -107,5 +107,7 @@ namespace Microsoft.Iris.Render } public bool IsApproximate(Vector2 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y); + + public string EncodeString() => $"{X}, {Y}"; } } diff --git a/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs b/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs index eb0662f..b5aea37 100644 --- a/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs +++ b/UIX.RenderApi/Microsoft/Iris/Render/Vector3.cs @@ -11,7 +11,7 @@ using System.Text; namespace Microsoft.Iris.Render { [Serializable] - public struct Vector3 + public struct Vector3 : IStringEncodable { private float m_x; private float m_y; @@ -130,5 +130,7 @@ namespace Microsoft.Iris.Render } public bool IsApproximate(Vector3 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y) && Math2.WithinEpsilon(this.m_z, vector.m_z); + + public string EncodeString() => $"{X}, {Y}, {Z}"; } } diff --git a/UIX/Microsoft/Iris/Drawing/Rotation.cs b/UIX/Microsoft/Iris/Drawing/Rotation.cs index d380f30..eb0b689 100644 --- a/UIX/Microsoft/Iris/Drawing/Rotation.cs +++ b/UIX/Microsoft/Iris/Drawing/Rotation.cs @@ -9,7 +9,7 @@ using System.Text; namespace Microsoft.Iris.Drawing { - public struct Rotation + public struct Rotation : IStringEncodable { private Vector3 _axis; private float _angleRad; @@ -62,5 +62,10 @@ namespace Microsoft.Iris.Drawing stringBuilder.Append(")"); return stringBuilder.ToString(); } + + public string EncodeString() + { + return $"{AngleRadians}rad;{Axis.EncodeString()}"; + } } } diff --git a/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs index 9643f33..4ed05c2 100644 --- a/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs @@ -9,7 +9,7 @@ using Microsoft.Iris.Library; namespace Microsoft.Iris.Layouts { - internal class DockLayoutInput : ILayoutInput + internal class DockLayoutInput : ILayoutInput, IStringEncodable { public static readonly DockLayoutInput Left = new DockLayoutInput(); public static readonly DockLayoutInput Top = new DockLayoutInput(); @@ -40,5 +40,7 @@ namespace Microsoft.Iris.Layouts } public override string ToString() => InvariantString.Format("{0}(Position={1})", GetType().Name, PositionString); + + public string EncodeString() => PositionString; } }