NanoXLSX.Core 3.0.0-rc.3
Loading...
Searching...
No Matches
NanoXLSX.Themes.Theme Class Reference

Class representing an Office theme. More...

Public Types

enum  ColorSchemeElement {
  Dark1 = 0 , Light1 = 1 , Dark2 = 2 , Light2 = 3 ,
  Accent1 = 4 , Accent2 = 5 , Accent3 = 6 , Accent4 = 7 ,
  Accent5 = 8 , Accent6 = 9 , Hyperlink = 10 , FollowedHyperlink = 11
}
 Enum to define the sequence index of color scheme element, used in the implementations of Interfaces.IColorScheme. More...

Public Member Functions

 Theme (string name)
 Constructor with parameters. Using this constructor initialized the Colors property with valid default values.
override bool Equals (object obj)
 Returns whether two instances are the same.
override int GetHashCode ()
 Returns a hash code for this instance.

Static Public Attributes

const string DefaultThemeVersion = "166925"
 Default theme ID, stated in the workbook document.

Properties

string Name [get, set]
 Gets or sets the name of the theme.
ColorScheme Colors [get, set]
 Gets or sets the ColorScheme of the theme.
bool DefaultTheme [get]
 Gets whether the theme is defined as copy or reference to the application default theme.

Detailed Description

Class representing an Office theme.

Definition at line 15 of file Theme.cs.

Member Enumeration Documentation

◆ ColorSchemeElement

Enum to define the sequence index of color scheme element, used in the implementations of Interfaces.IColorScheme.

Enumerator
Dark1 

Dark 1.

Light1 

Light 1.

Dark2 

Dark 2.

Light2 

Light 2.

Accent1 

Accent 1.

Accent2 

Accent 2.

Accent3 

Accent 3.

Accent4 

Accent 4.

Accent5 

Accent 5.

Accent6 

Accent 6.

Hyperlink 

Hyperlink.

FollowedHyperlink 

Followed Hyperlink.

Definition at line 34 of file Theme.cs.

Constructor & Destructor Documentation

◆ Theme()

NanoXLSX.Themes.Theme.Theme ( string name)

Constructor with parameters. Using this constructor initialized the Colors property with valid default values.

Parameters
nameName of the theme

Definition at line 82 of file Theme.cs.

Member Function Documentation

◆ Equals()

override bool NanoXLSX.Themes.Theme.Equals ( object obj)

Returns whether two instances are the same.

Parameters
objObject to compare
Returns
True if this instance and the other are the same

Definition at line 134 of file Theme.cs.

◆ GetHashCode()

override int NanoXLSX.Themes.Theme.GetHashCode ( )

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable to be used in hashing algorithms and data structures like a hash table.

Definition at line 147 of file Theme.cs.

Member Data Documentation

◆ DefaultThemeVersion

const string NanoXLSX.Themes.Theme.DefaultThemeVersion = "166925"
static

Default theme ID, stated in the workbook document.

Remarks
According to the official OOXML documentation (part 1, chapter 18.2.28) the version consists of the application version and build where the excel file was created. The value was extracted from a valid Excel file, created with Excel 2019. However, although '16' can be assumed to be the Version of Excel 2019, the build part '6925' cannot be originated, is not reflecting the retrieved application build version, and seems not to be listed publicly

Definition at line 26 of file Theme.cs.

Property Documentation

◆ Colors

ColorScheme NanoXLSX.Themes.Theme.Colors
getset

Gets or sets the ColorScheme of the theme.

Definition at line 70 of file Theme.cs.

◆ DefaultTheme

bool NanoXLSX.Themes.Theme.DefaultTheme
get

Gets whether the theme is defined as copy or reference to the application default theme.

Remarks
This indication and the default theme (Theme.GetDefaultTheme) may still deviate from the actual default theme defined by the handling application (e.g. Excel)- The property is not written into Excel files

Definition at line 76 of file Theme.cs.

◆ Name

string NanoXLSX.Themes.Theme.Name
getset

Gets or sets the name of the theme.

Definition at line 66 of file Theme.cs.


The documentation for this class was generated from the following file: