當前位置: 首頁>>代碼示例>>C#>>正文


C# AdvancedSubStationAlpha.LoadSubtitle方法代碼示例

本文整理匯總了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);
 }
開發者ID:socialpercon,項目名稱:subtitleedit,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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);
 }
開發者ID:socialpercon,項目名稱:subtitleedit,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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);
 }
開發者ID:socialpercon,項目名稱:subtitleedit,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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);
 }
開發者ID:KatyaMarincheva,項目名稱:SubtitleEditOriginal,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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);
 }
開發者ID:KatyaMarincheva,項目名稱:SubtitleEditOriginal,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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);
 }
開發者ID:KatyaMarincheva,項目名稱:SubtitleEditOriginal,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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);
 }
開發者ID:KatyaMarincheva,項目名稱:SubtitleEditOriginal,代碼行數:9,代碼來源:SubtitleFormatsTest.cs

示例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();
 }
開發者ID:rragu,項目名稱:subtitleedit,代碼行數:28,代碼來源:SubStationAlphaStyles.cs


注:本文中的Nikse.SubtitleEdit.Logic.SubtitleFormats.AdvancedSubStationAlpha.LoadSubtitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。