C# Класс SubLib.Core.Domain.SubtitleCollection

A container that represents all the subtitles.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
SetPropertiesForAll ( SubtitleProperties properties ) : void

Описание методов

Add() публичный Метод

Adds a subtitle to the end of the collection.
public Add ( Subtitle subtitle ) : void
subtitle Subtitle The subtitle to add.
Результат void

Add() публичный Метод

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.
Результат void

AddNewAfter() публичный Метод

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.
Результат bool

AddNewAfter() публичный Метод

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.
Результат bool

AddNewAt() публичный Метод

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.
Результат bool

AddNewAt() публичный Метод

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
Результат bool

AddNewBefore() публичный Метод

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.
Результат bool

AddNewBefore() публичный Метод

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.
Результат bool

Clone() публичный Метод

public Clone ( SubtitleProperties propertiesClone ) : SubtitleCollection
propertiesClone SubtitleProperties
Результат SubtitleCollection

Contains() публичный Метод

Checks whether a subtitle with the specified index exists in the collection.
public Contains ( int index ) : bool
index int The zero-based index.
Результат bool

Get() публичный Метод

Returns the subtitle at the specified index.
public Get ( int index ) : Subtitle
index int The zero-based subtitle's index.
Результат Subtitle

GetEnumerator() публичный Метод

Returns an enumerator that can iterate through the collection.
public GetEnumerator ( ) : IEnumerator
Результат IEnumerator

Remove() публичный Метод

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.
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

this() публичный Метод

public this ( int index ) : Subtitle
index int
Результат Subtitle