TableStyleFormatCollection Class
Represents a collection of conditional TableStyleFormats.
public sealed class TableStyleFormatCollection : IEnumerable<TableStyleFormat>, IEnumerable
Public NotInheritable Class TableStyleFormatCollection
Implements IEnumerable(Of TableStyleFormat), IEnumerable
- Inheritance:
- System.ObjectTableStyleFormatCollection
Remarks
Table style conditional formats are applied to different regions of the table and allow you to define all formatting properties (formatting for a table, rows, cells, paragraphs and runs).
For more information about table styles, see table styles article and table styles example.
Properties
Item[TableStyleFormatType]
Gets the TableStyleFormat that corresponds to given format type.
If TableStyleFormatCollection doesn't contain corresponding format, then new format will be added and returned.
public TableStyleFormat this[TableStyleFormatType formatType] { get; }
Public ReadOnly Property Item(formatType As TableStyleFormatType) As TableStyleFormat
Parameters
formatType
- TableStyleFormatType
The format type of the TableStyleFormat.
Property Value
The TableStyleFormat that corresponds to given format type.
Remarks
For more information about table styles, see table styles article and table styles example.
Methods
Add(TableStyleFormat)
Sets the specified formats. This method is required to support C# collection initializer syntax.
public void Add(TableStyleFormat styleFormat)
Public Sub Add(styleFormat As TableStyleFormat)
Parameters
styleFormat
- TableStyleFormat
The style format.
Clear()
Clears the TableStyleFormatCollection.
Contains(TableStyleFormatType)
Determines whether the TableStyleFormatCollection contains a TableStyleFormat instance with specific format type.
public bool Contains(TableStyleFormatType formatType)
Public Function Contains(formatType As TableStyleFormatType) As Boolean
Parameters
formatType
- TableStyleFormatType
Format type of the TableStyleFormat to locate in the TableStyleFormatCollection.
Returns
- System.Boolean
true if TableStyleFormat instance with specific format type is found in the TableStyleFormatCollection; otherwise, false.
Remarks
For more information about table styles, see table styles article and table styles example.
GetEnumerator()
Returns an enumerator that iterates through the TableStyleFormatCollection.
public IEnumerator<TableStyleFormat> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of TableStyleFormat)
Returns
- System.Collections.Generic.IEnumerator<TableStyleFormat>
A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the TableStyleFormatCollection.
Remove(TableStyleFormatType)
Removes the TableStyleFormat with the specified format type from the TableStyleFormatCollection.
public bool Remove(TableStyleFormatType formatType)
Public Function Remove(formatType As TableStyleFormatType) As Boolean
Parameters
formatType
- TableStyleFormatType
Format type of the TableStyleFormat which should be removed from the TableStyleFormatCollection.
Returns
- System.Boolean
true if TableStyleFormat is successfully removed; otherwise, false. This method also returns false if TableStyleFormat was not found in the TableStyleFormatCollection.
Remarks
For more information about table styles, see table styles article and table styles example.