40 private int textRotation;
147 get {
return textDirection; }
150 textDirection = value;
151 CalculateInternalRotation();
160 get {
return textRotation; }
163 textRotation = value;
165 CalculateInternalRotation();
189 throw new StyleException(
"The indent value '" + value +
"' is not valid. It must be >= 0");
218 internal int CalculateInternalRotation()
220 if (textRotation < -90 || textRotation > 90)
231 if (textRotation >= 0)
237 return (90 - textRotation);
248 StringBuilder sb =
new StringBuilder();
249 sb.Append(
"\"StyleXF\": {\n");
251 AddPropertyAsJson(sb,
"Alignment",
Alignment);
256 AddPropertyAsJson(sb,
"Locked",
Locked);
257 AddPropertyAsJson(sb,
"Hidden",
Hidden);
258 AddPropertyAsJson(sb,
"Indent",
Indent);
259 AddPropertyAsJson(sb,
"HashCode", this.
GetHashCode(),
true);
261 return sb.ToString();
274 int hashCode = 626307906;
276 hashCode = hashCode * -1521134295 +
Hidden.GetHashCode();
278 hashCode = hashCode * -1521134295 +
Locked.GetHashCode();
279 hashCode = hashCode * -1521134295 +
Alignment.GetHashCode();
280 hashCode = hashCode * -1521134295 +
TextDirection.GetHashCode();
281 hashCode = hashCode * -1521134295 +
TextRotation.GetHashCode();
282 hashCode = hashCode * -1521134295 +
VerticalAlign.GetHashCode();
283 hashCode = hashCode * -1521134295 +
Indent.GetHashCode();
295 return obj is
CellXf xf &&
340 #region staticMethods
Class for exceptions regarding Style incidents.
Class represents an abstract style component.
static readonly TextDirectionValue DefaultTextDirection
Default text direction value as constant.
override int GetHashCode()
Returns a hash code for this instance.
static readonly HorizontalAlignValue DefaultHorizontalAlignment
Default horizontal align value as constant.
HorizontalAlignValue
Enum for the horizontal alignment of a cell, used by the CellXf class.
@ General
General alignment.
@ Justify
justify alignment
@ Center
Content will be aligned in the center.
@ None
No alignment. The alignment will not be used in a style.
@ Distributed
Distributed alignment.
@ Right
Content will be aligned right.
@ Left
Content will be aligned left.
@ CenterContinuous
Center continuous alignment.
TextDirectionValue
Enum for the general text alignment direction, used by the CellXf class.
@ Vertical
Text direction is vertical.
@ Horizontal
Text direction is horizontal (default).
static readonly VerticalAlignValue DefaultVerticalAlignment
Default vertical align value as constant.
bool Hidden
Gets or sets whether the hidden property (used for protection or hiding of cells) will be defined in ...
TextBreakValue Alignment
Gets or sets the text break options of the style.
int TextRotation
Gets or sets the text rotation in degrees (from +90 to -90).
bool ForceApplyAlignment
Gets or sets whether the applyAlignment property (used to merge cells) will be defined in the XF entr...
bool Locked
Gets or sets whether the locked property (used for locking / protection of cells or worksheets) will ...
static readonly TextBreakValue DefaultAlignment
Default text break value as constant.
VerticalAlignValue
Enum for the vertical alignment of a cell, used by the CellXf class.
@ Bottom
Content will be aligned on the bottom (default).
@ Top
Content will be aligned on the top.
CellXf()
Default constructor.
int Indent
Gets or sets the indentation in case of left, right or distributed alignment. If 0,...
TextBreakValue
Enum for text break options, used by the CellXf class.
@ WrapText
Word wrap is active.
@ ShrinkToFit
Text will be resized to fit the cell.
VerticalAlignValue VerticalAlign
Gets or sets the vertical alignment of the style.
TextDirectionValue TextDirection
Gets or sets the direction of the text within the cell.
override string ToString()
Override toString method.
override bool Equals(object obj)
Returns whether two instances are the same.
CellXf CopyCellXf()
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.
HorizontalAlignValue HorizontalAlign
Gets or sets the horizontal alignment of the style.
Class representing a Fill (background) entry. The Fill entry is used to define background colors and ...
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.