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:
- System.ObjectCustomSlideShowCollection
Implements
Properties
Count
Gets the number of CustomSlideShows contained in the collection.
Property Value
- System.Int32
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
- System.Int32
The zero-based index of the CustomSlideShow to get or set.
Property Value
The CustomSlideShow at the specified index.
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 CustomSlideShowCollection or its name is null or System.String.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
- System.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
- System.ArgumentNullException
item
is null.
- System.ArgumentException
item
is already contained in another CustomSlideShowCollection or its name is null or System.String.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
- System.String
The name of the custom show.
Returns
A newly added custom show with the specified name.
Exceptions
- System.ArgumentException
name
is either null or System.String.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
- 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 CustomSlideShowCollection.
public IEnumerator<CustomSlideShow> GetEnumerator()
Public Function GetEnumerator As IEnumerator(Of CustomSlideShow)
Returns
- System.Collections.Generic.IEnumerator<CustomSlideShow>
An System.Collections.Generic.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
- System.Int32
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
- System.Int32
The zero-based index at which CustomSlideShow should be inserted.
item
- CustomSlideShow
The CustomSlideShow to insert into the collection.
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 CustomSlideShowCollection or its name is null or System.String.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
- System.Int32
The position in the collection where the new custom show should be inserted.
name
- System.String
The name of the custom show.
Returns
A newly inserted custom show with the specified name.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than 0 or greater than Count.
- System.ArgumentException
name
is either null or System.String.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
- 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 CustomSlideShow at the specified index of the collection.
Parameters
index
- System.Int32
The zero-based index of the CustomSlideShow to remove.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than zero or index
is equal to or greater than Count.