本文整理汇总了C#中Nikse.SubtitleEdit.Logic.SubtitleFormats.AdvancedSubStationAlpha.LoadSubtitle方法的典型用法代码示例。如果您正苦于以下问题:C# AdvancedSubStationAlpha.LoadSubtitle方法的具体用法?C# AdvancedSubStationAlpha.LoadSubtitle怎么用?C# AdvancedSubStationAlpha.LoadSubtitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nikse.SubtitleEdit.Logic.SubtitleFormats.AdvancedSubStationAlpha
的用法示例。
在下文中一共展示了AdvancedSubStationAlpha.LoadSubtitle方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssSimpleFontColor1
public void AssSimpleFontColor1()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\c&HFF&}Font"), null);
string actual = subtitle.Paragraphs[0].Text;
string expected = "<font color=\"#ff0000\">Font</font>";
Assert.AreEqual(expected, actual);
}
示例2: AssSimpleBold
public void AssSimpleBold()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\b1}Bold{\b0}"), null);
string actual = subtitle.Paragraphs[0].Text;
string expected = "<b>Bold</b>";
Assert.AreEqual(expected, actual);
}
示例3: AssFontNameAndSize
public void AssFontNameAndSize()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\fnViner Hand ITC\fs28}Testing"), null);
string actual = subtitle.Paragraphs[0].Text;
const string expected = "<font face=\"Viner Hand ITC\" size=\"28\">Testing</font>";
Assert.AreEqual(expected, actual);
}
示例4: AssSimpleFontColorAndItalic
public void AssSimpleFontColorAndItalic()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\1c&HFFFF00&\i1}CYAN{\i0}"), null);
string actual = subtitle.Paragraphs[0].Text;
const string expected = "<font color=\"#00ffff\"><i>CYAN</i></font>";
Assert.AreEqual(expected, actual);
}
示例5: AssSimpleFontName
public void AssSimpleFontName()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\fnArial}Font"), null);
string actual = subtitle.Paragraphs[0].Text;
const string expected = "<font face=\"Arial\">Font</font>";
Assert.AreEqual(expected, actual);
}
示例6: AssSimpleUnderline
public void AssSimpleUnderline()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\u1}Underline{\u0}"), null);
string actual = subtitle.Paragraphs[0].Text;
const string expected = "<u>Underline</u>";
Assert.AreEqual(expected, actual);
}
示例7: AssSimpleItalic
public void AssSimpleItalic()
{
var target = new AdvancedSubStationAlpha();
var subtitle = new Subtitle();
target.LoadSubtitle(subtitle, GetAssLines(@"{\i1}Italic{\i0}"), null);
string actual = subtitle.Paragraphs[0].Text;
const string expected = "<i>Italic</i>";
Assert.AreEqual(expected, actual);
}
示例8: buttonRemoveAll_Click
private void buttonRemoveAll_Click(object sender, EventArgs e)
{
listViewStyles.Items.Clear();
var sub = new Subtitle();
if (_isSubStationAlpha)
{
var ssa = new SubStationAlpha();
string text = ssa.ToText(sub, string.Empty);
string[] lineArray = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
var lines = new List<string>();
foreach (string line in lineArray)
lines.Add(line);
ssa.LoadSubtitle(sub, lines, string.Empty);
Header = Header.Remove(Header.IndexOf("[V4 Styles]")) + sub.Header.Substring(sub.Header.IndexOf("[V4 Styles]"));
}
else
{
var ass = new AdvancedSubStationAlpha();
string text = ass.ToText(sub, string.Empty);
string[] lineArray = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
var lines = new List<string>();
foreach (string line in lineArray)
lines.Add(line);
ass.LoadSubtitle(sub, lines, string.Empty);
Header = Header.Remove(Header.IndexOf("[V4+ Styles]")) + sub.Header.Substring(sub.Header.IndexOf("[V4+ Styles]"));
}
InitializeListView();
}