TableStyleCollection Class
Represents a collection of TableStyles.
public sealed class TableStyleCollection : Collection<TableStyle>, IList, ICollection, IList<TableStyle>, ICollection<TableStyle>, IEnumerable<TableStyle>, IEnumerable
Public NotInheritable Class TableStyleCollection
Inherits Collection(Of TableStyle)
Implements IList, ICollection, IList(Of TableStyle), ICollection(Of TableStyle), IEnumerable(Of TableStyle), IEnumerable
- Inheritance:
- TableStyleCollection
Implements
Properties
Default
Gets or sets the default table style for newly added tables.
Property Value
The default table style for newly added tables.
Exceptions
Value cannot be null.
The specified table style cannot be set because it doesn't belong to presentation's table styles collection.
Methods
Contains(TableStyleName)
Determines whether a built-in TableStyle with the specified name is in the collection.
public bool Contains(TableStyleName builtInStyleName)
Public Function Contains(builtInStyleName As TableStyleName) As Boolean
Parameters
builtInStyleName
- TableStyleName
Name of the built-in TableStyle to locate in the collection.
Returns
true if the built-in TableStyle with the specified name is found in the collection; otherwise, false.
Contains(String)
Determines whether a custom TableStyle with the specified name is in the collection.
public bool Contains(string styleName)
Public Function Contains(styleName As String) As Boolean
Parameters
styleName
- String
Name of the custom TableStyle to locate in the collection.
Returns
true if the custom TableStyle with the specified name is found in the collection; otherwise, false.
Create(TableStyleName)
Creates a new instance of a TableStyle based on a specified built-in table style.
The created instance is not automatically added to the collection.
public TableStyle Create(TableStyleName builtInStyleName)
Public Function Create(builtInStyleName As TableStyleName) As TableStyle
Parameters
builtInStyleName
- TableStyleName
Name of the built-in table style whose formatting settings will be copied to a newly created table style.
Returns
A new instance of a TableStyle based on a specified built-in table style.
Create(String)
Creates a new instance of a TableStyle based on a NoStyleNoGrid built-in table style and with the specified name.
The created instance is not automatically added to the collection.
public TableStyle Create(string styleName)
Public Function Create(styleName As String) As TableStyle
Parameters
styleName
- String
Name of the created table style.
Returns
A new instance of a TableStyle based on a NoStyleNoGrid built-in table style and with the specified name.
GetOrAdd(TableStyleName)
Gets or creates and adds a new built-in TableStyle with the specified name.
public TableStyle GetOrAdd(TableStyleName builtInStyleName)
Public Function GetOrAdd(builtInStyleName As TableStyleName) As TableStyle
Parameters
builtInStyleName
- TableStyleName
Name of the built-in TableStyle.
Returns
An existing or a newly added instance of a built-in TableStyle.
GetOrAdd(String)
Gets or creates and adds a new custom TableStyle with the specified name.
public TableStyle GetOrAdd(string styleName)
Public Function GetOrAdd(styleName As String) As TableStyle
Parameters
styleName
- String
Name of the custom TableStyle.
Returns
An existing or a newly added instance of a custom TableStyle.