C# Class SubLib.Core.Domain.SubtitleCollection

A container that represents all the subtitles.
Mostra file Open project: GNOME/gnome-subtitles Class Usage Examples

Public Methods

Method 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

Method Description
SetPropertiesForAll ( SubtitleProperties properties ) : void

Method Details

Add() public method

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

Add() public method

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.
return void

AddNewAfter() public method

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.
return bool

AddNewAfter() public method

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.
return bool

AddNewAt() public method

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.
return bool

AddNewAt() public method

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
return bool

AddNewBefore() public method

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.
return bool

AddNewBefore() public method

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.
return bool

Clone() public method

public Clone ( SubtitleProperties propertiesClone ) : SubtitleCollection
propertiesClone SubtitleProperties
return SubtitleCollection

Contains() public method

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

Get() public method

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

GetEnumerator() public method

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

Remove() public method

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.
return void

ToString() public method

public ToString ( ) : string
return string

this() public method

public this ( int index ) : Subtitle
index int
return Subtitle