C# Class SubLib.Core.Domain.SubtitleText

Represents the text of a subtitle.
Inheritance: ICloneable
Datei anzeigen Open project: GNOME/gnome-subtitles Class Usage Examples

Public Methods

Method Description
Add ( string newLines ) : void
Clear ( ) : void
Clone ( ) : object
Get ( ) : string

Gets the subtitle text.

The text lines end with the new line (\n) char.

Get ( string lineBreak ) : string

Gets the text lines merged with the specified line break.

GetEnumerator ( ) : IEnumerator
GetLine ( int index ) : string

Gets the specified text line.

GetLines ( ) : string[]
GetReplaceEmptyLines ( string replacement ) : string

Gets the text lines and replaces those that are empty.

The text lines are merged by the newline (\n) char. A subtitle line is considered empty if it has no characters.

GetReplaceEmptyLines ( string replacement, string lineBreak ) : string

Gets the text lines merged with the specified line break and replaces those that are empty.

A subtitle line is considered empty if it has no characters.

GetTrimLines ( ) : string

Gets and trims the text lines.

The text lines are merged by the newline (\n) char. A subtitle line is considered blank ifit has only white spaces.

GetTrimLines ( string lineBreak ) : string

Gets and trims the text lines merged with the specified line break.

A subtitle line is considered blank if it has only white spaces.

Set ( string text ) : void

Sets the subtitle text.

Newline (\n) is used as the line break. The text lines are not trimmed.

Set ( string text, string lineBreak, bool toTrimLines ) : void

Sets the subtitle text using the specified line break and trimming option.

SubtitleText ( ) : System

Initializes a new instance of the SubtitleText class, with empty text.

SubtitleText ( string text ) : System

Initializes a new instance of the SubtitleText class with the specified text.

Newline (\n) is used as the line break. The text lines are not trimmed.

SubtitleText ( string text, string lineBreak, bool toTrimLines ) : System

Initializes a new instance of the SubtitleText class with the specified text, line break and trimming option.

ToString ( ) : string

Private Methods

Method Description
ReplaceLineIfEmpty ( string textLine, string replacement ) : string

Method Details

Add() public method

public Add ( string newLines ) : void
newLines string
return void

Clear() public method

public Clear ( ) : void
return void

Clone() public method

public Clone ( ) : object
return object

Get() public method

Gets the subtitle text.
The text lines end with the new line (\n) char.
public Get ( ) : string
return string

Get() public method

Gets the text lines merged with the specified line break.
public Get ( string lineBreak ) : string
lineBreak string The line break used to merge the text.
return string

GetEnumerator() public method

public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetLine() public method

Gets the specified text line.
public GetLine ( int index ) : string
index int The zero-based line number index.
return string

GetLines() public method

public GetLines ( ) : string[]
return string[]

GetReplaceEmptyLines() public method

Gets the text lines and replaces those that are empty.
The text lines are merged by the newline (\n) char. A subtitle line is considered empty if it has no characters.
public GetReplaceEmptyLines ( string replacement ) : string
replacement string The text to replace empty lines with.
return string

GetReplaceEmptyLines() public method

Gets the text lines merged with the specified line break and replaces those that are empty.
A subtitle line is considered empty if it has no characters.
public GetReplaceEmptyLines ( string replacement, string lineBreak ) : string
replacement string The text to replace empty lines with.
lineBreak string The line break used to merge the text.
return string

GetTrimLines() public method

Gets and trims the text lines.
The text lines are merged by the newline (\n) char. A subtitle line is considered blank ifit has only white spaces.
public GetTrimLines ( ) : string
return string

GetTrimLines() public method

Gets and trims the text lines merged with the specified line break.
A subtitle line is considered blank if it has only white spaces.
public GetTrimLines ( string lineBreak ) : string
lineBreak string The line break used to merge the text.
return string

Set() public method

Sets the subtitle text.
Newline (\n) is used as the line break. The text lines are not trimmed.
public Set ( string text ) : void
text string The subtitle text.
return void

Set() public method

Sets the subtitle text using the specified line break and trimming option.
public Set ( string text, string lineBreak, bool toTrimLines ) : void
text string The subtitle text.
lineBreak string The text substring used to split the text in lines.
toTrimLines bool Whether to trim every text line.
return void

SubtitleText() public method

Initializes a new instance of the SubtitleText class, with empty text.
public SubtitleText ( ) : System
return System

SubtitleText() public method

Initializes a new instance of the SubtitleText class with the specified text.
Newline (\n) is used as the line break. The text lines are not trimmed.
public SubtitleText ( string text ) : System
text string The subtitle text.
return System

SubtitleText() public method

Initializes a new instance of the SubtitleText class with the specified text, line break and trimming option.
public SubtitleText ( string text, string lineBreak, bool toTrimLines ) : System
text string The subtitle text.
lineBreak string The text substring that marks the end of lines.
toTrimLines bool Whether to trim every text line.
return System

ToString() public method

public ToString ( ) : string
return string