mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Add IStringEncodable
This commit is contained in:
@@ -4,9 +4,11 @@
|
||||
// MVID: D47658B8-A8EA-43D6-8837-ECE823BFFFC1
|
||||
// Assembly location: C:\Program Files\Zune\UIX.RenderApi.dll
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.Iris.Render
|
||||
{
|
||||
public struct Inset
|
||||
public struct Inset : IStringEncodable
|
||||
{
|
||||
private int _left;
|
||||
private int _top;
|
||||
@@ -74,6 +76,14 @@ namespace Microsoft.Iris.Render
|
||||
|
||||
public override string ToString() => base.ToString();
|
||||
|
||||
public string EncodeString()
|
||||
{
|
||||
var values = new int[] { Left, Top, Right, Bottom };
|
||||
if (new HashSet<int>(values).Count == 1)
|
||||
return Top.ToString();
|
||||
return string.Join(", ", values);
|
||||
}
|
||||
|
||||
internal Point TopLeft
|
||||
{
|
||||
get => new Point(this.Left, this.Top);
|
||||
|
||||
@@ -8,7 +8,7 @@ using System;
|
||||
|
||||
namespace Microsoft.Iris.Render
|
||||
{
|
||||
public struct Size
|
||||
public struct Size : IStringEncodable
|
||||
{
|
||||
private int m_width;
|
||||
private int m_height;
|
||||
@@ -106,5 +106,7 @@ namespace Microsoft.Iris.Render
|
||||
size1.Scale(flScale);
|
||||
return size1;
|
||||
}
|
||||
|
||||
public string EncodeString() => $"{Width}, {Height}";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user