8using System.Collections.Generic;
34 private string diagonalColor;
35 private string leftColor;
36 private string rightColor;
37 private string topColor;
38 private string bottomColor;
75#pragma warning disable CA1720
77#pragma warning restore CA1720
113 get => diagonalColor;
123 diagonalColor = value;
250 int hashCode = -153001865;
251 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
BottomColor);
252 hashCode = hashCode * -1521134295 +
BottomStyle.GetHashCode();
253 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
DiagonalColor);
254 hashCode = hashCode * -1521134295 +
DiagonalDown.GetHashCode();
255 hashCode = hashCode * -1521134295 +
DiagonalUp.GetHashCode();
256 hashCode = hashCode * -1521134295 +
DiagonalStyle.GetHashCode();
257 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
LeftColor);
258 hashCode = hashCode * -1521134295 +
LeftStyle.GetHashCode();
259 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
RightColor);
260 hashCode = hashCode * -1521134295 +
RightStyle.GetHashCode();
261 hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(
TopColor);
262 hashCode = hashCode * -1521134295 +
TopStyle.GetHashCode();
274 return obj is
Border border &&
328 StringBuilder sb =
new StringBuilder();
329 sb.Append(
"\"Border\": {\n");
334 AddPropertyAsJson(sb,
"DiagonalUp",
DiagonalUp);
335 AddPropertyAsJson(sb,
"LeftColor",
LeftColor);
336 AddPropertyAsJson(sb,
"LeftStyle",
LeftStyle);
337 AddPropertyAsJson(sb,
"RightColor",
RightColor);
338 AddPropertyAsJson(sb,
"RightStyle",
RightStyle);
339 AddPropertyAsJson(sb,
"TopColor",
TopColor);
340 AddPropertyAsJson(sb,
"TopStyle",
TopStyle);
341 AddPropertyAsJson(sb,
"HashCode", this.
GetHashCode(),
true);
343 return sb.ToString();
350 internal bool IsEmpty()
381 #region staticMethods
387 internal static string GetStyleName(
StyleValue style)
393 case StyleValue.Dotted: output =
"dotted";
break;
394 case StyleValue.DashDotDot: output =
"dashDotDot";
break;
395 case StyleValue.DashDot: output =
"dashDot";
break;
396 case StyleValue.Dashed: output =
"dashed";
break;
398 case StyleValue.MediumDashDotDot: output =
"mediumDashDotDot";
break;
399 case StyleValue.SlantDashDot: output =
"slantDashDot";
break;
400 case StyleValue.MediumDashDot: output =
"mediumDashDot";
break;
401 case StyleValue.MediumDashed: output =
"mediumDashed";
break;
402 case StyleValue.Medium: output =
"medium";
break;
403 case StyleValue.Thick: output =
"thick";
break;
404 case StyleValue.Double: output =
"double";
break;
414 internal static StyleValue GetStyleEnum(
string styleName)
420 case "dashDotDot":
return StyleValue.DashDotDot;
424 case "mediumDashDotDot":
return StyleValue.MediumDashDotDot;
425 case "slantDashDot":
return StyleValue.SlantDashDot;
426 case "mediumDashDot":
return StyleValue.MediumDashDot;
427 case "mediumDashed":
return StyleValue.MediumDashed;
Class represents an abstract style component.
override string ToString()
Override toString method.
StyleValue DiagonalStyle
Gets or sets the style of the diagonal lines.
StyleValue LeftStyle
Gets or sets the style of left cell border.
bool DiagonalDown
Gets or sets whether the downwards diagonal line is used. If true, the line is used.
static readonly StyleValue DefaultBorderStyle
Default border style as constant.
StyleValue RightStyle
Gets or sets the style of right cell border.
string RightColor
Gets or sets the color code of the right border. The value is expressed as hex string with the format...
static readonly string DefaultBorderColor
Default border color as constant.
StyleValue BottomStyle
Gets or sets the style of bottom cell border.
string LeftColor
Gets or sets the color code of the left border. The value is expressed as hex string with the format ...
StyleValue TopStyle
Gets or sets the style of top cell border.
Border()
Default constructor.
bool DiagonalUp
Gets or sets whether the upwards diagonal line is used. If true, the line is used.
string BottomColor
Gets or sets the color code of the bottom border. The value is expressed as hex string with the forma...
string TopColor
Gets or sets the color code of the top border. The value is expressed as hex string with the format A...
override int GetHashCode()
Returns a hash code for this instance.
StyleValue
Enum for the border style, used by the Border class.
@ MediumDashDot
medium dash-dotted border
@ MediumDashDotDot
medium-dashed border with double-dots
@ MediumDashed
medium dashed border
@ SlantDashDot
slant dash-dotted border
@ DashDotDot
dashed border with double-dots
@ DashDot
dash-dotted border
string DiagonalColor
Gets or sets the color code of the diagonal lines. The value is expressed as hex string with the form...
Border CopyBorder()
Method to copy the current object to a new one with casting.
override AbstractStyle Copy()
Method to copy the current object to a new one without casting.
override bool Equals(object obj)
Returns whether two instances are the same.
Class providing static methods to parse string values to specific types or to print object as languag...
static string ToUpper(string input)
Transforms a string to upper case with null check and invariant culture.
Class providing general validator methods.
static void ValidateColor(string hexCode, bool useAlpha, bool allowEmpty=false)
Validates the passed string, whether it is a valid RGB or ARGB value that can be used for Fills or Fo...