TableRowCollection Class
Represents a collection of TableRows.
public sealed class TableRowCollection : TableElementCollection<TableRow>, IList, ICollection, IList<TableRow>, ICollection<TableRow>, IEnumerable<TableRow>, IEnumerable
Public NotInheritable Class TableRowCollection
Inherits TableElementCollection(Of TableRow)
Implements IList, ICollection, IList(Of TableRow), ICollection(Of TableRow), IEnumerable(Of TableRow), IEnumerable
- Inheritance:
- System.ObjectTableRowCollection
Implements
Properties
Count
Gets the number of TableRows contained in the collection.
Property Value
- System.Int32
The number of TableRows contained in the collection.
Item[Int32]
Gets or sets the TableRow at the specified index.
public TableRow this[int index] { get; set; }
Public Property Item(index As Integer) As TableRow
Parameters
index
- System.Int32
The zero-based index of the TableRow to get or set.
Property Value
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
- System.ArgumentNullException
value
is null.
- System.ArgumentException
value
is already contained in another TableRowCollection.
TextContent
Gets the text content of the current TableRowCollection.
Property Value
The text content of the current TableRowCollection.
Remarks
For more information, see Find and Replace example.
Methods
Add(TableRow)
Adds a TableRow to the end of the collection.
Parameters
Exceptions
- System.ArgumentNullException
item
is null.
- System.ArgumentException
item
is already contained in another TableRowCollection.
AddClone(TableRow)
Adds a clone of the source
TableRow to the end of the collection. Clone will be formatted using the destination theme.
public TableRow AddClone(TableRow source)
Public Function AddClone(source As TableRow) As TableRow
Parameters
Returns
Remarks
Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).
Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.
Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.
When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.
This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.
Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.
Exceptions
- System.ArgumentNullException
source
parameter is null.
AddClone(TableRow, CloneContext)
Adds a clone of the source
TableRow to the end of the collection.
public TableRow AddClone(TableRow source, CloneContext context)
Public Function AddClone(source As TableRow, context As CloneContext) As TableRow
Parameters
context
- CloneContext
The context used to maintain reference mapping in multiple cloning operations.
Returns
Remarks
Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).
Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.
Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.
When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.
This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.
Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.
Exceptions
- System.ArgumentNullException
source
or context
parameter is null.
- System.ArgumentException
source
is not associated with the SourcePresentation or the current collection is not associated with the DestinationPresentation of the context
.
AddNew(Length)
Adds a new TableRow with the specified width to the end of the collection.
Parameters
Returns
Exceptions
- System.ArgumentOutOfRangeException
height
is not greater than zero.
Clear()
Removes all TableRows from the collection.
Contains(TableRow)
Determines whether a TableRow is in the collection.
Parameters
Returns
- System.Boolean
true if item
is found in the collection; otherwise, false.
Exceptions
- System.ArgumentNullException
item
is null.
GetEnumerator()
Returns an enumerator that iterates through the TableRowCollection.
public IEnumerator<TableRow> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of TableRow)
Returns
- System.Collections.Generic.IEnumerator<TableRow>
An System.Collections.Generic.IEnumerator<T> for the collection.
IndexOf(TableRow)
Searches for the specified TableRow and returns the zero-based index of the first occurrence within the entire collection.
Parameters
Returns
- System.Int32
The zero-based index of the first occurrence of item
within the entire collection, if found; otherwise, -1.
Insert(Int32, TableRow)
Inserts a TableRow to the collection at the specified index.
public void Insert(int index, TableRow item)
Public Sub Insert(index As Integer, item As TableRow)
Parameters
index
- System.Int32
The zero-based index at which TableRow should be inserted.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
- System.ArgumentNullException
item
is null.
- System.ArgumentException
item
is already contained in another TableRowCollection.
InsertClone(Int32, TableRow)
Inserts a clone of the source
TableRow to the collection at the specified index. Clone will be formatted using the destination theme.
public TableRow InsertClone(int index, TableRow source)
Public Function InsertClone(index As Integer, source As TableRow) As TableRow
Parameters
index
- System.Int32
The zero-based index at which clone of the source
TableRow should be inserted.
Returns
Remarks
Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).
Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.
Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.
When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.
This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.
Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.
Exceptions
- System.ArgumentNullException
source
parameter is null.
InsertClone(Int32, TableRow, CloneContext)
Inserts a clone of the source
TableRow to the collection at the specified index.
public TableRow InsertClone(int index, TableRow source, CloneContext context)
Public Function InsertClone(index As Integer, source As TableRow, context As CloneContext) As TableRow
Parameters
index
- System.Int32
The zero-based index at which clone of the source
TableRow should be inserted.
context
- CloneContext
The context used to maintain reference mapping in multiple cloning operations.
Returns
Remarks
Cloning is a process when one or more objects from a presentation are duplicated. Objects can be duplicated to the same or another presentation and to the same or another location (for example, to another slide).
Cloning methods are available on collection types, such as SlideCollection, DrawingCollection, TextParagraphCollection or TextElementCollection. Exception is the PresentationDocument type that has a Clone() method used to make a deep clone of the entire presentation. Cloning methods available on the collection types have two forms: AddClone(Slide) and InsertClone(Int32, Slide) to append the duplicate to the collection or insert it into a specific location in the collection.
Objects contained in the presentation can contain references to other objects. For example, Slide contains a reference to its ParentTemplate, Connector can contain a reference to drawings that it connects (BeginConnection and EndConnection), Action can contain a Target to Slide or CustomSlideShow that should be shown when the action is triggered.
When cloning multiple objects, the desired behavior is to maintain these references in the duplicated objects so that, for example, when Connector is cloned, and later when drawings that it connects are cloned, the duplicated Connector also connects duplicates of the original drawings that are connected.
This reference mapping between an original object and its duplicate is maintained by the instance of the CloneContext type. CloneContext instance is created with Create(PresentationDocument, PresentationDocument) static method. Each object can be cloned exactly once using the same CloneContext instance. If you want to clone the same object multiple times, each time a new CloneContext instance must be used. CloneContext is the most useful when cloning multiple objects one after another or when you want to change a behavior of the cloning operation.
Behavior of the cloning operation can be changed by using Set<T>(T, T) method. With this method you can make an explicit mapping between objects and cloning process will respect that mapping. For example, if you are cloning a Slide instance to another PresentationDocument default behavior would be that its parent template LayoutSlide and MasterSlide would also be cloned to another PresentationDocument. This behavior can be changed by making an explicit mapping from the LayoutSlide that is the ParentTemplate of the Slide that will be cloned to some LayoutSlide in the another PresentationDocument that we wish to be a ParentTemplate of the duplicated Slide. Explicit mapping with Set<T>(T, T) method can currently be made between following type (and their derivatives) instances: SlideObject, Drawing, TableStyle and CustomSlideShow.
Exceptions
- System.ArgumentNullException
source
or context
parameter is null.
- System.ArgumentException
source
is not associated with the SourcePresentation or the current collection is not associated with the DestinationPresentation of the context
.
InsertNew(Int32, Length)
Inserts a new TableRow with the specified height to the collection at the specified index.
public TableRow InsertNew(int index, Length height)
Public Function InsertNew(index As Integer, height As Length) As TableRow
Parameters
index
- System.Int32
The zero-based index at which new TableRow should be inserted.
Returns
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.
- System.ArgumentOutOfRangeException
height
is not greater than zero.
Remove(TableRow)
Removes the first occurrence of a specific TableRow from the collection.
Parameters
Returns
- System.Boolean
true if item
is successfully removed; otherwise, false. This method also returns false if item
was not found in the original collection.
RemoveAt(Int32)
Removes the TableRow at the specified index of the collection.
Parameters
index
- System.Int32
The zero-based index of the TableRow to remove.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.