Class StyleImpl
Represents a style description. The Style object contains all style attributes (font, number format, alignment, and so on) as properties. There are several built-in styles, including Normal, Currency, and Percent. Using the Style object is a fast and efficient way to change several cell-formatting properties on multiple cells at the same time. For the Workbook object, the Style object is a member of the Styles collection. The Styles collection contains all the defined styles for the workbook.
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class StyleImpl : ExtendedFormatWrapper, IInternalExtendedFormat, IXFIndex, ICloneParent, IStyle, IExtendedFormat, IParentApplication, IOptimizedUpdate, IComparable, INamedObject
Constructors
StyleImpl(WorkbookImpl)
Initializes new instance of the style.
Declaration
public StyleImpl(WorkbookImpl book)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book | Parent workbook. |
StyleImpl(WorkbookImpl, StyleRecord)
Initializes new instance of the style.
Declaration
[CLSCompliant(false)]
public StyleImpl(WorkbookImpl book, StyleRecord style)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book | Parent workbook. |
StyleRecord | style | Style record to parse. |
StyleImpl(WorkbookImpl, String)
Initializes new instance of the style.
Declaration
public StyleImpl(WorkbookImpl book, string strName)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book | Parent workbook. |
System.String | strName | Name of the style to create. |
StyleImpl(WorkbookImpl, String, StyleImpl)
Initializes new instance of the style.
Declaration
public StyleImpl(WorkbookImpl book, string strName, StyleImpl baseStyle)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book | Parent workbook. |
System.String | strName | Name of the style to create. |
StyleImpl | baseStyle | Base style. |
StyleImpl(WorkbookImpl, String, StyleImpl, Boolean)
Initializes new instance of the style.
Declaration
public StyleImpl(WorkbookImpl book, string strName, StyleImpl baseStyle, bool bIsBuiltIn)
Parameters
Type | Name | Description |
---|---|---|
WorkbookImpl | book | Parent workbook. |
System.String | strName | Name of the style to create. |
StyleImpl | baseStyle | Base style. |
System.Boolean | bIsBuiltIn | Indicates whether created style is built in. |
Fields
DEF_EQUAL
Constant indicating that one object is equal to another. Used by CompareTo method.
Declaration
public const int DEF_EQUAL = 0
Field Value
Type |
---|
System.Int32 |
DEF_LARGER
Constant indicating that one object is larger than another. Used by CompareTo method.
Declaration
public const int DEF_LARGER = 1
Field Value
Type |
---|
System.Int32 |
DEF_LESS
Constant indicating that one object is less than another. Used by CompareTo method.
Declaration
public const int DEF_LESS = -1
Field Value
Type |
---|
System.Int32 |
Properties
BuiltIn
Indicates whether style is build in. Read-only.
Declaration
public bool BuiltIn { get; }
Property Value
Type |
---|
System.Boolean |
HasBorder
Gets if the style has border
Declaration
public bool HasBorder { get; }
Property Value
Type |
---|
System.Boolean |
Index
Returns index of the style's extended format.
Declaration
public int Index { get; }
Property Value
Type |
---|
System.Int32 |
IsBuiltInCustomized
Gets or sets if the style is built in customized
Declaration
public bool IsBuiltInCustomized { get; set; }
Property Value
Type |
---|
System.Boolean |
IsInitialized
Indicates whether style is initialized (differs from Normal style). Read-only.
Declaration
public bool IsInitialized { get; }
Property Value
Type |
---|
System.Boolean |
Name
Returns name of the style. Read-only.
Declaration
public string Name { get; }
Property Value
Type |
---|
System.String |
NotCompareNames
Indicates whether do not to compare name during CompareTo operation.
Declaration
public bool NotCompareNames { get; set; }
Property Value
Type |
---|
System.Boolean |
Record
Returns style record. Read-only.
Declaration
[CLSCompliant(false)]
public StyleRecord Record { get; }
Property Value
Type |
---|
StyleRecord |
Methods
BeginUpdate()
This method is called before any changed are made in styles.
Declaration
public override void BeginUpdate()
Overrides
Clone(Object)
Creates copy of the current instance.
Declaration
public override object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new collection. |
Returns
Type | Description |
---|---|
System.Object | Copy of the current instance. |
Overrides
CompareTo(Object)
Compares the current instance with another object of the same type.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | An object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that indicates the relative order of the comparands. The return value has these meanings: Value Meaning Less than zero - This instance is less than obj. Zero - This instance is equal to obj. Greater than zero - This instance is greater than obj. |
EndUpdate()
This method is called after any changes are made in styles.
Declaration
public override void EndUpdate()
Overrides
Equals(Object)
A hash code for the current Object without taking cell list into account.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The Object to compare with the current Object. |
Returns
Type |
---|
System.Boolean |
Overrides
Serialize(OffsetArrayList)
Saves style into OffsetArrayList.
Declaration
[CLSCompliant(false)]
public void Serialize(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | OffsetArrayList to save style into. |
UpdateStyleRecord()
Updates style record according to the xf indexes.
Declaration
public void UpdateStyleRecord()
Events
AfterChange
This event is raised after any changes are made in styles.
Declaration
public event EventHandler AfterChange
Event Type
Type |
---|
System.EventHandler |
BeforeChange
This event is raised before any changes are made in styles.
Declaration
public event EventHandler BeforeChange
Event Type
Type |
---|
System.EventHandler |