2024-06-12 16:30:18 +01:00
|
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
2024-10-21 17:38:07 +01:00
|
|
|
|
namespace MouseJump.Common.Models.Styles;
|
2024-06-12 16:30:18 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents the border style for a drawing object.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public sealed class BorderStyle
|
|
|
|
|
|
{
|
2024-11-26 15:37:59 +00:00
|
|
|
|
public static readonly BorderStyle Empty = new(null, 0, 0);
|
2024-06-12 16:30:18 +01:00
|
|
|
|
|
2024-11-26 15:37:59 +00:00
|
|
|
|
public BorderStyle(Color? color, decimal all, decimal depth)
|
2024-06-12 16:30:18 +01:00
|
|
|
|
: this(color, all, all, all, all, depth)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-11-26 15:37:59 +00:00
|
|
|
|
public BorderStyle(Color? color, decimal left, decimal top, decimal right, decimal bottom, decimal depth)
|
2024-06-12 16:30:18 +01:00
|
|
|
|
{
|
|
|
|
|
|
this.Color = color;
|
|
|
|
|
|
this.Left = left;
|
|
|
|
|
|
this.Top = top;
|
|
|
|
|
|
this.Right = right;
|
|
|
|
|
|
this.Bottom = bottom;
|
|
|
|
|
|
this.Depth = depth;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-11-26 15:37:59 +00:00
|
|
|
|
public Color? Color
|
2024-06-12 16:30:18 +01:00
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Left
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Top
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Right
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Bottom
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the "depth" of the 3d highlight and shadow effect on the border.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public decimal Depth
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Horizontal => this.Left + this.Right;
|
|
|
|
|
|
|
|
|
|
|
|
public decimal Vertical => this.Top + this.Bottom;
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return "{" +
|
|
|
|
|
|
$"{nameof(this.Color)}={this.Color}," +
|
|
|
|
|
|
$"{nameof(this.Left)}={this.Left}," +
|
|
|
|
|
|
$"{nameof(this.Top)}={this.Top}," +
|
|
|
|
|
|
$"{nameof(this.Right)}={this.Right}," +
|
|
|
|
|
|
$"{nameof(this.Bottom)}={this.Bottom}," +
|
|
|
|
|
|
$"{nameof(this.Depth)}={this.Depth}" +
|
|
|
|
|
|
"}";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|