CustomSlideShowCollection Class
Represents a collection of custom shows that are available within the presentation.
public sealed class CustomSlideShowCollection : Collection<CustomSlideShow>, IList, ICollection, IList<CustomSlideShow>, ICollection<CustomSlideShow>, IEnumerable<CustomSlideShow>, IEnumerable
Public NotInheritable Class CustomSlideShowCollection
Inherits Collection(Of CustomSlideShow)
Implements IList, ICollection, IList(Of CustomSlideShow), ICollection(Of CustomSlideShow), IEnumerable(Of CustomSlideShow), IEnumerable
- Inheritance:
- CustomSlideShowCollection
Implements
Properties
Count
Gets the number of CustomSlideShows contained in the collection.
Property Value
The number of CustomSlideShows contained in the collection.
Item[Int32]
Gets or sets the CustomSlideShow at the specified index.
public CustomSlideShow this[int index] { get; set; }
Public Property Item(index As Integer) As CustomSlideShow
Parameters
index
- Int32
The zero-based index of the CustomSlideShow to get or set.
Property Value
The CustomSlideShow at the specified index.
Exceptions
index
is less than zero or index
is equal to or greater than Count.
value
is null.
value
is already contained in another CustomSlideShowCollection or its name is null or Empty or CustomSlideShow with the same name already exists in the CustomSlideShowCollection.
Item[String]
Gets the CustomSlideShow with the specified name or null if the custom show with the specified name does not exist in the collection.
public CustomSlideShow this[string name] { get; }
Public ReadOnly Property Item(name As String) As CustomSlideShow
Parameters
name
- String
Name of the custom show.
Property Value
The CustomSlideShow with the specified name.
Methods
Add(CustomSlideShow)
Adds a CustomSlideShow to the end of the collection.
Parameters
item
- CustomSlideShow
The CustomSlideShow to be added to the end of the collection.
Exceptions
item
is null.
item
is already contained in another CustomSlideShowCollection or its name is null or Empty or CustomSlideShow with the same name already exists in the CustomSlideShowCollection.
AddNew(String)
Adds a new custom show with the specified name.
public CustomSlideShow AddNew(string name)
Public Function AddNew(name As String) As CustomSlideShow
Parameters
name
- String
The name of the custom show.
Returns
A newly added custom show with the specified name.
Exceptions
name
is either null or Empty or custom show with the same name already exists in the collection.
Clear()
Removes all CustomSlideShows from the collection.
Contains(CustomSlideShow)
Determines whether a CustomSlideShow is in the collection.
public bool Contains(CustomSlideShow item)
Public Function Contains(item As CustomSlideShow) As Boolean
Parameters
item
- CustomSlideShow
The CustomSlideShow to locate in the collection.
Returns
true if item
is found in the collection; otherwise, false.
Exceptions
item
is null.
GetEnumerator()
Returns an enumerator that iterates through the CustomSlideShowCollection.
public IEnumerator<CustomSlideShow> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of CustomSlideShow)
Returns
An IEnumerator<T> for the collection.
IndexOf(CustomSlideShow)
Searches for the specified CustomSlideShow and returns the zero-based index of the first occurrence within the entire collection.
public int IndexOf(CustomSlideShow item)
Public Function IndexOf(item As CustomSlideShow) As Integer
Parameters
item
- CustomSlideShow
The CustomSlideShow to locate in the collection.
Returns
The zero-based index of the first occurrence of item
within the entire collection, if found; otherwise, -1.
Insert(Int32, CustomSlideShow)
Inserts a CustomSlideShow to the collection at the specified index.
public void Insert(int index, CustomSlideShow item)
Public Sub Insert(index As Integer, item As CustomSlideShow)
Parameters
index
- Int32
The zero-based index at which CustomSlideShow should be inserted.
item
- CustomSlideShow
The CustomSlideShow to insert into the collection.
Exceptions
index
is less than zero or index
is equal to or greater than Count.
item
is null.
item
is already contained in another CustomSlideShowCollection or its name is null or Empty or CustomSlideShow with the same name already exists in the CustomSlideShowCollection.
InsertNew(Int32, String)
Inserts a new custom show with the specified name at the specified index.
public CustomSlideShow InsertNew(int index, string name)
Public Function InsertNew(index As Integer, name As String) As CustomSlideShow
Parameters
index
- Int32
The position in the collection where the new custom show should be inserted.
name
- String
The name of the custom show.
Returns
A newly inserted custom show with the specified name.
Exceptions
index
is less than 0 or greater than Count.
name
is either null or Empty or custom show with the same name already exists in the collection.
Remove(CustomSlideShow)
Removes the first occurrence of a specific CustomSlideShow from the collection.
public bool Remove(CustomSlideShow item)
Public Function Remove(item As CustomSlideShow) As Boolean
Parameters
item
- CustomSlideShow
The CustomSlideShow to remove from the collection.
Returns
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 CustomSlideShow at the specified index of the collection.
Parameters
index
- Int32
The zero-based index of the CustomSlideShow to remove.
Exceptions
index
is less than zero or index
is equal to or greater than Count.