20 private bool internalStyle;
27 [
Append(NestedProperty =
true)]
32 [
Append(NestedProperty =
true)]
37 [
Append(NestedProperty =
true)]
42 [
Append(NestedProperty =
true)]
47 [
Append(NestedProperty =
true)]
54 public string Name {
get;
set; }
62 get {
return internalStyle; }
101 public Style(
string name,
int forcedOrder,
bool internalStyle)
110 this.internalStyle = internalStyle;
123 if (styleToAppend ==
null)
127 if (styleToAppend.GetType() == typeof(
Border))
131 else if (styleToAppend.GetType() == typeof(
CellXf))
135 else if (styleToAppend.GetType() == typeof(
Fill))
139 else if (styleToAppend.GetType() == typeof(
Font))
143 else if (styleToAppend.GetType() == typeof(
NumberFormat))
147 else if (styleToAppend.GetType() == typeof(
Style))
164 StringBuilder sb =
new StringBuilder();
165 sb.Append(
"{\n\"Style\": {\n");
166 AddPropertyAsJson(sb,
"Name",
Name);
167 AddPropertyAsJson(sb,
"HashCode", this.
GetHashCode());
173 return sb.ToString();
187 throw new StyleException(
"The hash of the style could not be created because one or more components are missing as references");
210 throw new StyleException(
"The style could not be copied because one or more components are missing as references");
Class for exceptions regarding Style incidents.
Class represents an abstract style component.
int? InternalID
Gets or sets the internal ID for sorting purpose in the Excel style document (nullable).
Class representing a Border entry. The Border entry is used to define frames and cell borders.
override int GetHashCode()
Returns a hash code for this instance.
Class representing an XF entry. The XF entry is used to make reference to other style instances like ...
override int GetHashCode()
Returns a hash code for this instance.
Class representing a Fill (background) entry. The Fill entry is used to define background colors and ...
override int GetHashCode()
Returns a hash code for this instance.
Class representing a Font entry. The Font entry is used to define text formatting.
override int GetHashCode()
Returns a hash code for this instance.
override AbstractStyle Copy()
Method to copy the current object to a new one without casting.
override string ToString()
Override toString method.
override int GetHashCode()
Returns a hash code for this instance.
string Name
Gets or sets the name of the informal style. If not defined, the automatically calculated hash will b...
Style CopyStyle()
Method to copy the current object to a new one with casting.
CellXf CurrentCellXf
Gets or sets the current CellXf object of the style.
Style Append(AbstractStyle styleToAppend)
Appends the specified style parts to the current one. The parts can be instances of sub-classes like ...
Style()
Default constructor.
Border CurrentBorder
Gets or sets the current Border object of the style.
Fill CurrentFill
Gets or sets the current Fill object of the style.
Style(string name)
Constructor with parameters.
bool IsInternalStyle
Gets whether the style is system internal. Such styles are not meant to be altered.
Style(string name, int forcedOrder, bool internalStyle)
Constructor with parameters (internal use).
Font CurrentFont
Gets or sets the current Font object of the style.
NumberFormat CurrentNumberFormat
Gets or sets the current NumberFormat object of the style.
Class providing static methods to parse string values to specific types or to print object as languag...
static string ToString(int input)
Transforms an integer to an invariant sting.