本文整理汇总了C#中Nikse.SubtitleEdit.Logic.Subtitle.ReloadLoadSubtitle方法的典型用法代码示例。如果您正苦于以下问题:C# Subtitle.ReloadLoadSubtitle方法的具体用法?C# Subtitle.ReloadLoadSubtitle怎么用?C# Subtitle.ReloadLoadSubtitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nikse.SubtitleEdit.Logic.Subtitle
的用法示例。
在下文中一共展示了Subtitle.ReloadLoadSubtitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReloadFromSourceView
private void ReloadFromSourceView()
{
if (_sourceViewChange)
{
SaveSubtitleListviewIndexes();
if (textBoxSource.Text.Trim().Length > 0)
{
var temp = new Subtitle(_subtitle);
SubtitleFormat format = GetCurrentSubtitleFormat();
var list = new List<string>(textBoxSource.Lines);
if (format != null && format.IsMine(list, null))
format.LoadSubtitle(temp, list, null);
else
format = temp.ReloadLoadSubtitle(new List<string>(textBoxSource.Lines), null);
if (format == null)
{
MessageBox.Show(_language.UnableToParseSourceView);
return;
}
else
{
_sourceViewChange = false;
MakeHistoryForUndo(_language.BeforeChangesMadeInSourceView);
_subtitle.ReloadLoadSubtitle(new List<string>(textBoxSource.Lines), null);
if (format.IsFrameBased)
_subtitle.CalculateTimeCodesFromFrameNumbers(CurrentFrameRate);
int index = 0;
foreach (object obj in comboBoxSubtitleFormats.Items)
{
if (obj.ToString() == format.FriendlyName)
comboBoxSubtitleFormats.SelectedIndex = index;
index++;
}
if (format.GetType() == typeof(AdvancedSubStationAlpha) || format.GetType() == typeof(SubStationAlpha))
{
string errors = AdvancedSubStationAlpha.CheckForErrors(_subtitle.Header);
if (!string.IsNullOrEmpty(errors))
MessageBox.Show(errors, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (format.GetType() == typeof(SubRip))
{
string errors = (format as SubRip).Errors;
if (!string.IsNullOrEmpty(errors))
MessageBox.Show(errors, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else if (format.GetType() == typeof(MicroDvd))
{
string errors = (format as MicroDvd).Errors;
if (!string.IsNullOrEmpty(errors))
MessageBox.Show(errors, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
else
{
_sourceViewChange = false;
MakeHistoryForUndo(_language.BeforeChangesMadeInSourceView);
_sourceViewChange = false;
_subtitle.Paragraphs.Clear();
}
_subtitleListViewIndex = -1;
SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
RestoreSubtitleListviewIndexes();
}
}
示例2: TabControlSubtitleSelecting
private void TabControlSubtitleSelecting(object sender, TabControlCancelEventArgs e)
{
if (tabControlSubtitle.SelectedIndex != TabControlSourceView && textBoxSource.Text.Trim().Length > 1)
{
var temp = new Subtitle(_subtitle);
SubtitleFormat format = temp.ReloadLoadSubtitle(new List<string>(textBoxSource.Lines), null);
if (format == null)
e.Cancel = true;
}
}