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