mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 19:22:53 +01:00
Subtitle: Chain ctor and make obj creation consistent
This commit is contained in:
parent
a4b039a03f
commit
921006c347
@ -27,24 +27,23 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
public List<HistoryItem> HistoryItems { get; }
|
||||
public bool CanUndo => HistoryItems.Count > 0;
|
||||
|
||||
public Subtitle()
|
||||
public Subtitle() : this(new List<Paragraph>(), new List<HistoryItem>())
|
||||
{
|
||||
Paragraphs = new List<Paragraph>();
|
||||
HistoryItems = new List<HistoryItem>();
|
||||
FileName = "Untitled";
|
||||
}
|
||||
|
||||
public Subtitle(List<HistoryItem> historyItems)
|
||||
: this()
|
||||
public Subtitle(List<Paragraph> paragraphs) : this(paragraphs, new List<HistoryItem>())
|
||||
{
|
||||
}
|
||||
|
||||
public Subtitle(List<HistoryItem> historyItems) : this(new List<Paragraph>(), historyItems)
|
||||
{
|
||||
HistoryItems = historyItems;
|
||||
}
|
||||
|
||||
public Subtitle(List<Paragraph> paragraphs, List<HistoryItem> historyItems)
|
||||
: this()
|
||||
{
|
||||
HistoryItems = historyItems;
|
||||
Paragraphs = paragraphs;
|
||||
FileName = "Untitled";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -76,10 +75,6 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
OriginalEncoding = subtitle.OriginalEncoding;
|
||||
}
|
||||
|
||||
public Subtitle(List<Paragraph> paragraphs) : this()
|
||||
{
|
||||
Paragraphs = paragraphs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the paragraph of index, null if out of bounds
|
||||
|
Loading…
Reference in New Issue
Block a user