C# Class SubLib.Core.Domain.SubtitleCollection

A container that represents all the subtitles.
Afficher le fichier Open project: GNOME/gnome-subtitles Class Usage Examples

Méthodes publiques

Méthode Description
Add ( Subtitle subtitle ) : void

Adds a subtitle to the end of the collection.

Add ( Subtitle subtitle, int index ) : void

Adds a subtitle to the collection, inserting it at the specified index.

AddNewAfter ( int index, SubtitleProperties subtitleProperties ) : bool

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right after that index.

The newly created subtitle's times will be based on the specified subtitle. Its start time will be the end time of the existing subtitle plus SubtitleConstants.MinTimeBetweenSubtitles. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.

AddNewAfter ( int index, SubtitleProperties subtitleProperties, int timeBetweenSubtitles ) : bool

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right after that index.

The newly created subtitle's times will be based on the specified subtitle. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.

AddNewAt ( int index, SubtitleProperties subtitleProperties ) : bool

Creates a subtitle and adds it to the collection, inserting it at the specified index.

The newly created subtitle's start time will be zero and its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.

AddNewAt ( int index, SubtitleProperties subtitleProperties, System.TimeSpan start ) : bool

Creates a subtitle and adds it to the collection, inserting it at the specified index and with the specified start time.

The newly created subtitle's duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.

AddNewBefore ( int index, SubtitleProperties subtitleProperties ) : bool

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right before that index.

The newly created subtitle's times will be based on the specified subtitle. Its end time will be the start time of the existing subtitle minus SubtitleConstants.MinTimeBetweenSubtitles. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration. Both times will be wrapped to zero if they are less than zero.

AddNewBefore ( int index, SubtitleProperties subtitleProperties, int timeBetweenSubtitles ) : bool

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right before that index.

The newly created subtitle's times will be based on the specified subtitle. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration. Both the start and end times times will be wrapped to zero if they are negative.

Clone ( SubtitleProperties propertiesClone ) : SubtitleCollection
Contains ( int index ) : bool

Checks whether a subtitle with the specified index exists in the collection.

Get ( int index ) : Subtitle

Returns the subtitle at the specified index.

GetEnumerator ( ) : IEnumerator

Returns an enumerator that can iterate through the collection.

Remove ( int index ) : void

Removes a subtitle from the collection, given its index.

ToString ( ) : string
this ( int index ) : Subtitle

Private Methods

Méthode Description
SetPropertiesForAll ( SubtitleProperties properties ) : void

Method Details

Add() public méthode

Adds a subtitle to the end of the collection.
public Add ( Subtitle subtitle ) : void
subtitle Subtitle The subtitle to add.
Résultat void

Add() public méthode

Adds a subtitle to the collection, inserting it at the specified index.
public Add ( Subtitle subtitle, int index ) : void
subtitle Subtitle The subtitle to add.
index int The zero-based index at which the subtitle should be inserted.
Résultat void

AddNewAfter() public méthode

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right after that index.
The newly created subtitle's times will be based on the specified subtitle. Its start time will be the end time of the existing subtitle plus SubtitleConstants.MinTimeBetweenSubtitles. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.
public AddNewAfter ( int index, SubtitleProperties subtitleProperties ) : bool
index int The zero-based index after which the subtitle should be inserted.
subtitleProperties SubtitleProperties The SubtitleProperties of the subtitles.
Résultat bool

AddNewAfter() public méthode

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right after that index.
The newly created subtitle's times will be based on the specified subtitle. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.
public AddNewAfter ( int index, SubtitleProperties subtitleProperties, int timeBetweenSubtitles ) : bool
index int The zero-based index after which the subtitle should be inserted.
subtitleProperties SubtitleProperties The SubtitleProperties of the subtitles.
timeBetweenSubtitles int The gap to keep after the existing subtitle, in milliseconds.
Résultat bool

AddNewAt() public méthode

Creates a subtitle and adds it to the collection, inserting it at the specified index.
The newly created subtitle's start time will be zero and its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.
public AddNewAt ( int index, SubtitleProperties subtitleProperties ) : bool
index int The zero-based index at which the subtitle should be inserted.
subtitleProperties SubtitleProperties The SubtitleProperties of the subtitles.
Résultat bool

AddNewAt() public méthode

Creates a subtitle and adds it to the collection, inserting it at the specified index and with the specified start time.
The newly created subtitle's duration will be SubtitleConstants.MaxSingleLineSubtitleDuration.
public AddNewAt ( int index, SubtitleProperties subtitleProperties, System.TimeSpan start ) : bool
index int The zero-based index at which the subtitle should be inserted.
subtitleProperties SubtitleProperties The SubtitleProperties of the subtitles.
start System.TimeSpan
Résultat bool

AddNewBefore() public méthode

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right before that index.
The newly created subtitle's times will be based on the specified subtitle. Its end time will be the start time of the existing subtitle minus SubtitleConstants.MinTimeBetweenSubtitles. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration. Both times will be wrapped to zero if they are less than zero.
public AddNewBefore ( int index, SubtitleProperties subtitleProperties ) : bool
index int The zero-based index before which the subtitle should be inserted.
subtitleProperties SubtitleProperties The SubtitleProperties of the subtitles.
Résultat bool

AddNewBefore() public méthode

Creates a subtitle based on the subtitle at the specified index and adds it to the collection, inserting it right before that index.
The newly created subtitle's times will be based on the specified subtitle. Its duration will be SubtitleConstants.MaxSingleLineSubtitleDuration. Both the start and end times times will be wrapped to zero if they are negative.
public AddNewBefore ( int index, SubtitleProperties subtitleProperties, int timeBetweenSubtitles ) : bool
index int The zero-based index before which the subtitle should be inserted.
subtitleProperties SubtitleProperties The SubtitleProperties of the subtitles.
timeBetweenSubtitles int The gap to keep before the existing subtitle, in milliseconds.
Résultat bool

Clone() public méthode

public Clone ( SubtitleProperties propertiesClone ) : SubtitleCollection
propertiesClone SubtitleProperties
Résultat SubtitleCollection

Contains() public méthode

Checks whether a subtitle with the specified index exists in the collection.
public Contains ( int index ) : bool
index int The zero-based index.
Résultat bool

Get() public méthode

Returns the subtitle at the specified index.
public Get ( int index ) : Subtitle
index int The zero-based subtitle's index.
Résultat Subtitle

GetEnumerator() public méthode

Returns an enumerator that can iterate through the collection.
public GetEnumerator ( ) : IEnumerator
Résultat IEnumerator

Remove() public méthode

Removes a subtitle from the collection, given its index.
public Remove ( int index ) : void
index int The zero-based index of the subtitle to be removed.
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

this() public méthode

public this ( int index ) : Subtitle
index int
Résultat Subtitle