/ src / modules / MouseUtils / MouseJump.Common / Models / Styles / BorderStyle.cs
BorderStyle.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  namespace MouseJump.Common.Models.Styles;
 6  
 7  /// <summary>
 8  /// Represents the border style for a drawing object.
 9  /// </summary>
10  public sealed class BorderStyle
11  {
12      public static readonly BorderStyle Empty = new(null, 0, 0);
13  
14      public BorderStyle(Color? color, decimal all, decimal depth)
15          : this(color, all, all, all, all, depth)
16      {
17      }
18  
19      public BorderStyle(Color? color, decimal left, decimal top, decimal right, decimal bottom, decimal depth)
20      {
21          this.Color = color;
22          this.Left = left;
23          this.Top = top;
24          this.Right = right;
25          this.Bottom = bottom;
26          this.Depth = depth;
27      }
28  
29      public Color? Color
30      {
31          get;
32      }
33  
34      public decimal Left
35      {
36          get;
37      }
38  
39      public decimal Top
40      {
41          get;
42      }
43  
44      public decimal Right
45      {
46          get;
47      }
48  
49      public decimal Bottom
50      {
51          get;
52      }
53  
54      /// <summary>
55      /// Gets the "depth" of the 3d highlight and shadow effect on the border.
56      /// </summary>
57      public decimal Depth
58      {
59          get;
60      }
61  
62      public decimal Horizontal => this.Left + this.Right;
63  
64      public decimal Vertical => this.Top + this.Bottom;
65  
66      public override string ToString()
67      {
68          return "{" +
69             $"{nameof(this.Color)}={this.Color}," +
70             $"{nameof(this.Left)}={this.Left}," +
71             $"{nameof(this.Top)}={this.Top}," +
72             $"{nameof(this.Right)}={this.Right}," +
73             $"{nameof(this.Bottom)}={this.Bottom}," +
74             $"{nameof(this.Depth)}={this.Depth}" +
75             "}";
76      }
77  }